Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Encoding 64kbs wav to mp3 (LAME) (Read 3641 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Encoding 64kbs wav to mp3 (LAME)

I have a problem encoding 64kbs wav to mp3 using LAME encoder. I simply get a second of white noise when i do it this way:
-h --resample 44.1 $wav $mp3
or
-h $wav $mp3

What would be the best practice to do this encoding?

Some php IDTAG class  gives me this info on my wav file:

Array
(
    [encoding] = UTF-8
    [filename] = php5D7.tmp
    [filepath] = C:/PHP/uploadtemp
    [filenamepath] = C:/PHP/uploadtemp/php5D7.tmp
    [mime_type] = audio/x-wave
    [riff] => Array
        (
            [raw] => Array (riff=>raw)
                (
                    [fmt ] => Array (riff=>raw=>fmt )
                        (
                            [wFormatTag] = 7
                            [nChannels] = 1
                            [nSamplesPerSec] = 8000
                            [nAvgBytesPerSec] = 8000
                            [nBlockAlign] = 1
                            [wBitsPerSample] = 8
                            [cbSize] = 0
                        )

                    [fact] => Array (riff=>raw=>fact)
                        (
                            [NumberOfSamples] = 38408
                        )

                )

            [audio] => Array (riff=>audio)
                (
                    [0] => Array (riff=>audio=>0)
                        (
                            [codec] = Microsoft mu-Law
                            [channels] = 1
                            [sample_rate] = 8000
                            [bitrate] = 64000
                            [bits_per_sample] = 8
                        )

                )

            [WAVE] => Array (riff=>WAVE)
                (
                    [fmt ] => Array (riff=>WAVE=>fmt )
                        (
                            [0] => Array (riff=>WAVE=>fmt =>0)
                                (
                                    [offset] = 12
                                    [size] = 18
                                    [data] = @@
                                )

                        )

                    [fact] => Array (riff=>WAVE=>fact)
                        (
                            [0] => Array (riff=>WAVE=>fact=>0)
                                (
                                    [offset] = 38
                                    [size] = 4
                                    [data] = �
                                )

                        )

                    [data] => Array (riff=>WAVE=>data)
                        (
                            [0] => Array (riff=>WAVE=>data=>0)
                                (
                                    [offset] = 50
                                    [size] = 38400
                                )

                        )

                )

            [header_size] = 38450
            [encoding] = ISO-8859-1
        )

    [playtime_seconds] = 4.8
    [bitrate] = 64000
    [playtime_string] = 0:05
)

Encoding 64kbs wav to mp3 (LAME)

Reply #1
It looks like your file is mulaw-encoded (wFormatTag==7) and that LAME doesn't support this. I guess you need an additional conversion step: 8bit mu-law to 16 bit LPCM.

Btw, in case the MP3 format is not a must and the file containing mainly speech you might be better off using something like Speex.

Cheers,
SG

 

Encoding 64kbs wav to mp3 (LAME)

Reply #2
@acecream:
You may want to try LAME using LibSndfile.