How to create simple mp3 file? - audio

How to create simple mp3 file? It can be just one tone 440hz playing for one minute for example. I know that there is the specification of mp3 but it's not so obvious and it is easy to do some mistake and receive incorrect format. May be someone already have any example of source code that create such simple mp3 file? Thank you :)

Related

Can FFMPEG or any other project detect an audio file contains only noises?

I have a batch of audio files which recording people's voice. But some of this audio files record only noises or microphone burst. I want to detect these files and jump over them while processing my program.
I'm not sure whether ffmpeg can do this. If yes, could you guys provide me a link of that method? If not, do you know if there is some other software can do this? Or do you have any solution or suggestion to this problem?
Thank you.
I would approach this by looking at peak values and duration. SOX is a program that allows shell scripting which could batch analyze this. There is a large user base and forum as well.
Here is a link to a forum topic discussing it's use on batch discovering peak values and outputting information to a .csv file.

Extract encoded message in WAV file

I've got a .wav file with a perfect square wave (PCM data with only "FF" or "00" bytes) and I'm positive there is some kind of encoded message in it.
I've tried everything I could think of to extract the encoded message in the file. From steganography to several different encoding schemes like NRZ, Manchester, Differential Manchester and got nothing.
I'm three days into analysis of the file and driving mad by now.
Can any of you think of some way (or software) that can perform any kind of analysis on uncompressed pcm data?
P.S.: The decoding of the file is part of a quiz with various steps and that is the reason I would rather not post the file or ask for a direct answer.
I want to get there myself, just needing someone pointing me in a new direction or fresh thoughts about the problem! :D
In te meanwhile I got some invaluable help and figured out it was a tape from a zx spectrum in form of a .wav file.
So all it took was downloading some emulator and loading the tape (.wav file)!
But thank you so much for helping Mike! :D

.wac to .wav conversion

I've been asked to sample some data in a .wac file type. I'm not familiar with this standard and there is very little on the internet with regards to this format. I got given the .wav file but I don't think it was converted correctly, in that there was a none existent of the RIFF header so no .wav reader was able to read it.
Could anyone therefore shed some light into how I could possibly convert the .wac file into a .wav file? Doing some research, I cannot seem to find a converter tool on the internet, and, MatLab does not have a module for reading in .wac data.
NOTE: I've put the tag "game-engine" because according to this website: Here it is used in the infinity game engine.
I've come up with the following solution, however, massive thanks to #jpaari for his input.
Basically, I used sox:
sox -r 44100 -e unsigned -b 8 -c 1 input.raw output.wav
I was able to re-name the file to .raw and this worked. I'm going to update the Sample Rate to what #Aybe posted.
Try this http://www.shsforums.net/topic/39117-ps-gui-v304/
I think Audacity can do it aswell. Also the "unity3d" tag is not quite right.

ffmpeg - Can I draw an audio channel as an image?

I'm wondering if it's possible to draw an audio channel of a video or audio file as an image using ffmpeg, or if there's another tool that would do it on Win2k8 x64. I'm doing this as part of an encoding process after a user uploads a video or audio file.
I'm using ColdFusion 10 to handle the upload and calling cfexecute to run ffmpeg.
I need the image to look something like this (without the horizontal lines):
You can do this programmatically very easily.
Study the basics of FFmpeg. I suggest you to compile this sample. It explains how to open a video/audio, identify the streams and loop over the packets.
Once you have the data packet (in this case you are interested only in the audio packets). You will decode it (line 87 of this document) and obtain the raw data of an audio. It's the waveform itself (the analogue "bitmap" for an audio).
You could also study this sample. This second example is how to write a video/audio file. You don't want to write any video, but with this sample you can easily understand how the audio raw data packet works, if you see the functions get_audio_frame() and write_audio_frame().
You need to have some knowledge about creating a bitmap. Any platform has an easy way to do that.
So, the answer for you: YES, IT IS POSSIBLE TO DO THIS WITH FFMPEG! But you have to code a little bit in order to get what you want...
UPDATE:
Sorry, there are ALSO built-in features for this:
You could use those filters... or
showspectrum, showwaves, avectorscope
Here are some examples on how to use it: FFmpeg Filters - 12.22 showwaves.

Extract Wavelength from MP3 as an Image

Are there any good libraries that can help convert an MP3 into an image of its wavelengths (I think that's the proper term). What I'm looking for is a way to generate the wavelengths of MP3s server-side like is done on Souncloud: http://soundcloud.com/smixx/takin-vc-money-money-cash-ipos
What would be the best approach to extact that type of image from an audio file?
This would be the best response from the community:
http://andrewfreiday.com/2010/04/29/generating-mp3-waveforms-with-php/
The correct term is WAVEFORM that's what you see #soundcloud.
From what I've seen, the PHP script is pretty lightweight and awesome!
BTW: I just realized that the stackoverflow question points to the same PHP code #andrewfreiday
EDIT: Just a FYI, I started playing with node.js for a while now and while I was making a simple MP3 player I started using this packaged for the waveform.
https://www.npmjs.com/package/waveform-data

Resources