search

Home  >  Q&A  >  body text

php - Use getID3 to read the audio file of wav self-recorded by ios, but the duration cannot be read?

I can read the information from the wav file I downloaded from the Internet. The correct thing is this:
On the php side, I use getID3 to process the audio information!

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

<code>array:15 [

  "GETID3_VERSION" => "1.9.14-201703261440"

  "filesize" => 18627884

  "filepath" => "C:/Windows"

  "filename" => "php20E6.tmp"

  "filenamepath" => "C:/Windows/php20E6.tmp"

  "avdataoffset" => 44

  "avdataend" => 18627884

  "fileformat" => "wav"

  "audio" => array:12 [

    "dataformat" => "wav"

    "bitrate_mode" => "cbr"

    "wformattag" => 1

    "streams" => array:1 [

      0 => array:10 [

        "codec" => "Pulse Code Modulation (PCM)"

        "channels" => 2

        "sample_rate" => 44100

        "bitrate" => 1411200

        "bits_per_sample" => 16

        "wformattag" => 1

        "bitrate_mode" => "cbr"

        "lossless" => true

        "dataformat" => "wav"

        "compression_ratio" => 1

      ]

    ]

    "codec" => "Pulse Code Modulation (PCM)"

    "channels" => 2

    "sample_rate" => 44100

    "bitrate" => 1411200

    "bits_per_sample" => 16

    "lossless" => true

    "channelmode" => "stereo"

    "compression_ratio" => 1

  ]

  "encoding" => "UTF-8"

  "mime_type" => "audio/x-wav"

  "riff" => array:5 [

    "raw" => array:1 [

      "fmt " => array:6 [

        "wFormatTag" => 1

        "nChannels" => 2

        "nSamplesPerSec" => 44100

        "nAvgBytesPerSec" => 176400

        "nBlockAlign" => 4

        "wBitsPerSample" => 16

      ]

    ]

    "audio" => array:1 [

      0 => array:5 [

        "codec" => "Pulse Code Modulation (PCM)"

        "channels" => 2

        "sample_rate" => 44100

        "bitrate" => 1411200

        "bits_per_sample" => 16

      ]

    ]

    "header_size" => 18627876

    "WAVE" => array:2 [

      "fmt " => array:1 [

        0 => array:3 [

          "offset" => 12

          "size" => 16

          "data" => b"\x01\x00\x02\x00D¬\x00\x00\x10±\x02\x00\x04\x00\x10\x00"

        ]

      ]

      "data" => array:1 [

        0 => array:2 [

          "offset" => 36

          "size" => 18627840

        ]

      ]

    ]

    "encoding" => "ISO-8859-1"

  ]

  "playtime_seconds" => 105.6

  "bitrate" => 1411200

  "playtime_string" => "1:46"

]</code>

When reading audio self-recorded on iOS, the following problem occurred. I could not read the duration of the audio.

1

2

3

4

5

6

7

8

9

10

11

<code>array:7 [

  "GETID3_VERSION" => "1.9.14-201703261440"

  "filesize" => 115223

  "filepath" => "C:/Windows"

  "filename" => "phpAA25.tmp"

  "filenamepath" => "C:/Windows/phpAA25.tmp"

  "encoding" => "UTF-8"

  "error" => array:1 [

    0 => "unable to determine file format"

  ]

]</code>

Has anyone encountered this kind of problem? Please give me some guidance!

伊谢尔伦伊谢尔伦2903 days ago719

reply all(1)I'll reply

  • 黄舟

    黄舟2017-05-16 13:06:06

    I don’t know much about iOS devices. If getID3 can’t solve this problem

    It is recommended to use FFMPEG to read, provided that ffmpeg is installed on the server

    1

    2

    <code>$ffprobe = FFMpeg\FFProbe::create();

    print_r ($ffprobe ->format('/path/to/wav')->all());</code>

    reply
    0
  • Cancelreply