How to play MP3 files in C?

Using FMOD (cross platform), this should be as simple as this: #include <conio.h> #include “inc/fmod.h” FSOUND_SAMPLE* handle; int main () { // init FMOD sound system FSOUND_Init (44100, 32, 0); // load and play mp3 handle=FSOUND_Sample_Load (0,”my.mp3″,0, 0, 0); FSOUND_PlaySound (0,handle); // wait until the users hits a key to end the app while (!_kbhit()) … Read more

How to convert MP3 to WAV in Python

I maintain an open source library, pydub, which can help you out with that. from pydub import AudioSegment sound = AudioSegment.from_mp3(“/path/to/file.mp3”) sound.export(“/output/path/file.wav”, format=”wav”) One caveat: it uses ffmpeg to handle audio format conversions (except for wav files, which python handles natively). note: you probably shouldn’t do this conversion on GAE :/ even if it did … Read more

Android : Record sound in mp3 format

There’s a work around for saving .mp3 files using MediaRecorder. Here’s how: recorder = new MediaRecorder(); recorder.setAudioSource(MediaRecorder.AudioSource.MIC); recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4); recorder.setOutputFile(Environment.getExternalStorageDirectory() .getAbsolutePath() + “/myrecording.mp3”); recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC); recorder.prepare(); recorder.start(); The important part here is the setOuputFormat and the setAudioEncoder. Apparently MediaRecorder records playable mp3 if you’re using MediaRecorder.OutputFormat.MPEG_4 and MediaRecorder.AudioEncoder.AAC together. Hope this helps somebody. Of course, if you’d … Read more

iPhone: AVAudioPlayer unsupported file type

At long last i have found a solution to this problem! Instead of initializing the audio player with the NSData object, I saved the file to the Documents folder, and then initialized the player with the file URL //download file and play from disk NSData *audioData = [NSData dataWithContentsOfURL:someURL]; NSString *docDirPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) … Read more

How to read and write ID3 tags to an MP3 in C#? [closed]

Taglib# is the best. It’s direct port of the TagLib C library to C#. To install TagLib#, run the following command in the Package Manager Console in Visual Studio. PM> Install-Package taglib The NuGet distribution of taglib-sharp can be found at http://nuget.org/packages/taglib. The official source code repository is at https://github.com/mono/taglib-sharp. Here’s an example using the … Read more

Streaming Audio from A URL in Android using MediaPlayer?

simple Media Player with streaming example.For xml part you need one button with id button1 and two images in your drawable folder with name button_pause and button_play and please don’t forget to add the internet permission in your manifest. public class MainActivity extends Activity { private Button btn; /** * help to toggle between play … Read more