Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

voice file conversion

by perlthirst (Scribe)
on Dec 17, 2008 at 10:41 UTC ( #730885=perlquestion: print w/replies, xml ) Need Help??
perlthirst has asked for the wisdom of the Perl Monks concerning the following question:

Am having one voice file which is in the format, $file filename filename:RIFF (little-endian) data, WAVE audio, ITU G.711 A-law, mono 8000 Hz Now the codec of this file is A-law, I want to convert this file into U-law, is there any perl module for this?

Replies are listed 'Best First'.
Re: voice file conversion
by zentara (Archbishop) on Dec 17, 2008 at 12:07 UTC
    There are some Perl programs around to do the conversions, but they usually use sox. There are alot of docs ,tutorials, and tips available for the right syntax for the conversion. For example, search for " sox A-law U-law" and you will find answers.

    Here is basically how you would run sox thru system.

    #!/usr/bin/perl use warnings; #converts 8bit wav files to 16bit my @files = <*.wav>; foreach my $file(@files){ my ($name) = $file =~ /(.*).wav$/; system("sox -b $name.wav -w $name.16.wav"); }

    I'm not really a human, but I play one on earth Remember How Lucky You Are
Re: voice file conversion
by marto (Bishop) on Dec 17, 2008 at 10:45 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://730885]
Approved by ww
[james28909]: it would be to much work just to get around renaming three subs lol
[james28909]: but you could put it all in one sub and return the same data type that was inputted. i could write a small example maybe
[Lady_Aleena]: Their uses are also vastly different.
[Lady_Aleena]: The first two make hashes and arrays from a file, the third returns data from a pre-existing hash.
[Lady_Aleena]: Well, HoH and AoH respectively.
[Lady_Aleena]: But if you want to play, play. I don't mind. 8)

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2017-05-24 05:06 GMT
Find Nodes?
    Voting Booth?