Forum Rule: Always post complete source code & details to reproduce any issue!
-
how to play raw audio file in PC .
Dear pjrc team ,
first , thanks you for your effort in teensy module and it shiled as it save time for development and how easy it is .
I have audio shield for teensy 3.1 , it work fine and great .. but now if I wanna to play RAW file in the pc ? what possible way to do it , I am not interest to play it from module it self .
thanks in advance and regards
-
They're .WAV files, should be able to play them with most normal audio progs. VLC, Windows Media Player...
-
-
Senior Member
I believe you can open/import raw binary data into Audacity, which can play the sound or do all sorts of editing stuff.
The sox utility can convert between almost any formats, including raw data. That's what I usually use, since it's quicker than having to fiddle with a graphical program. But if you're not used to command line stuff, especially on Windows, Audacity is probably easier to learn.
I'm sure there are many other programs, but those are the 2 I've personally used. Both work great.
-
Senior Member
When you import raw audio data, any program will need you to specify details, like the data width, sample rate, number of channels, and byte order.
If you get the data width or byte order wrong, the result is usually terrible noise. RAW files from the Teensy Audio Library should be 16 bit, LSB first (little endian) format.
-

Originally Posted by
PaulStoffregen
When you import raw audio data, any program will need you to specify details, like the data width, sample rate, number of channels, and byte order.
If you get the data width or byte order wrong, the result is usually terrible noise. RAW files from the Teensy Audio Library should be 16 bit, LSB first (little endian) format.
so is monoaural PCM 16 bit 44.1khz little endian? thanks Paul and i should be able to import it with audacity ? thanks.
-
Senior Member
Monoaural PCM 16 bit 44.1khz data could be either little endian or big endian. It all depends on the byte order used by the software that wrote the file.
The Teensy Audio Library uses little endian. Many other program also use little endian by default, but I can't comment on any specific software other than what I've written.
-

Originally Posted by
PaulStoffregen
I believe you can open/import raw binary data into
Audacity, which can play the sound or do all sorts of editing stuff.
The
sox utility can convert between almost any formats, including raw data. That's what I usually use, since it's quicker than having to fiddle with a graphical program. But if you're not used to command line stuff, especially on Windows, Audacity is probably easier to learn.
I'm sure there are many other programs, but those are the 2 I've personally used. Both work great.
I've tryed to play with sox but i got lost with all the options, i would love if you could post an example sox commandline to convert teensy's raw files to WAV.
Thanks, much apreciated.
-

Originally Posted by
PaulStoffregen
Monoaural PCM 16 bit 44.1khz data could be either little endian or big endian. It all depends on the byte order used by the software that wrote the file.
The Teensy Audio Library uses little endian. Many other program also use little endian by default, but I can't comment on any specific software other than what I've written.
Yep i was taliking about the teensy raw files, thanks.
-
Senior Member
Here's a quick example:
Code:
sox -b 16 -c 1 -r 44100 -e signed-integer 001.raw 001.wav
Because the raw data is just bytes, sox needs you to give it all those details about the format. Then it can output WAV or other formats.
-
Sorry to bother you guys, but it seems to be a related topic about audio file playback issue. I have a question and do not know whether or not i should post here for some answers. Recently i have a audio file with .au extension. It can not be played on any of my devices or vlc and windows media player. Then I downloaded this software (http://www.videoconverterfactory.com...au-to-mp3.html) to help me change AU to MP3. But you can see from the article that it asks me to preset audio parameters in the course of conversion process. I don't know what bit rate and sample rate value I should preset for the best output? If it is that the higher they are the better the output will be? Or I am wrong? Don’t be mad at me because I am a noob.
-
Use Audacity Software. You'll get excellent results. It takes a lot more time to export the file than to import it. You can adjust your mp3 rate, bit rate and more in Audacity's Preferences.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules