SoundManager + FFMPEG causing loud popping sound when streaming MP3s? - streaming

I built an application that plays both uploaded original mp3 files, and copies that have been converted with FFMPEG. I am finding that in some cases the FFMPEG files have a horrible popping/clicking/screeching sound for a split second at startup (hear below). But when I analyze the file in an audio editor there is nothing there, so it seems to be either the browser or soundManager reacting badly to something in that file. Wondering if there is any way I can fix this either by adjusting FFMPEG settings, soundManager settings, or..... Any suggestions?
I've uploaded the offending sound in the link below (before the music starts playing).
Hear sound

Screeching/clicking at the beginning often points to a badly formed mp3 file. (There are a lot of them in the wild.)
Try checking both the original and converted files with mp3check -e -B
If you get errors, adding mp3check --cut-junk-start to your pipline should work.

Related

Trying to play an audio file

I'm trying to play an audio file in a cocos2d application. Here is the line which tries to play the sound:
[[SimpleAudioEngine sharedEngine] playEffect:#"pig_squeal.wav"];
If I put a log near this line, the log appears, and I can play the sound with iTunes. But when the sound should be played, there is a message displayed:
AudioStreamBasicDescription: 2 ch, 44100 Hz, 'lpcm' (0x00000C2C) 8.24-bit little-endian signed integer, deinterleaved
What's the problem?
This was discussed in comments but I've amalgamated all the possibilities of why it may not work here.:
That's not an error message, just some information.
Is the sound definitely in your library and a part of the target?
You haven't changed the volume of the SimpleAudioEngine or the volume of your device isn't all the way down?
Click the sound in your library. Press Option+Command+1 to bring up the file editor. Scroll down to "Target Membership" and ensure the sound is checked for your target.
Try a different sound effect too? Try and narrow the problem down to "is it SimpleAudioEngine".
Also try and playBackgroundMusic for a sound (This was the solution in this case)
And try an mp3
There isn't a problem. It's a status message written to the log when you initialise the current OpenAL context using alcMakeContextCurrent. As far as I'm aware, you can't get rid of the message.
There is no problems with your code for the Playing of the Sound. Please check the Sound file has been added to the project also do check the format of the sound. It should play the Sound whenever you call the Play Effect. Please also try to PRELOAD the sound effect in the init method.
that message means the song was read correctly and should be playing. possible reasons you don't hear it?
volume turned down.
device malfunctioning
audio has silence in it
audio file is large and will take a long time to load.
sound has been redirect to come out of the headphones or the ear piece (even if not attached)
But the sound is loading and most likely playing.
If you are getting a crash while running in device from xcode pls try this(worked for me). Dissconnect the device from Xcode and run the app in the device. I dont know why it worked like that. But when I did this there was no crash.

In Xcode which audio file types loop seamlessly?

So, I have read that if you want to make an audio sound play and loop, mp3 doesn't work well because it has a gap. Are there any file types that work and when looped don't have a gap? If so, which types?
For me, .aiff works best. It loops seamlessly and has a small file size, but .wav works too.

How can i detect CODEC in MPMoviePlayerController in iphone-sdk

When Video is made with the Sorenson CODEC... MPMoviePlayerController just plays Audio(and not the Video), Instead i want to show my custom error message at this point. How can i detect which CODEC is used by particular File programmatically ... ?
EDIT: I am not using Quick time in my code so that solution won't work
Thanks
Check this documentation to understand the Quicktime file format :
http://developer.apple.com/library/mac/documentation/QuickTime/QTFF/qtff.pdf
The field you are looking for is the "vfmt" code that is containing the video fourcc code (there is one for each video track in your file, so take care if your file is containing several video tracks). The fourcc codes for Sorenson codec are "SVQ1" and "SVQ3".
Now you'll have to write some code to parse the QT file to find the correct atom, extract the "vfmt" value and compare it to SVQ1/SVQ3 !
Apple is providing some classes to easily parse quicktime files, but it is only available on Mac OS, not on iOS !

how to convert MID file to wav file?

I want to play background music in my game application using AVAudio player.I am using .MDI file.This file is not playing in AVAudio player.So i want to convert this .MDi file to wav file.IS it possible?
Yes, it is possible. Assuming you're trying to convert it on a Mac the following steps will result in a MIDI file being converted to a WAV file (should also work on PC's and Linux O/S's).
Download and install Audacity
Once Audacity has been downloaded and installed (launch Audacity)
Open your MIDI file that you want to convert to WAV (don't play it yet though). Quicktime Player should be fine
Back in the Audacity application, press the Record button (red circle), you should see a recording take place, play your MIDI file that's opened in the Quicktime Player.
Once the MIDI file in Quicktime Player has stopped, press the stop button (yellow square)
Go to File -> Export As WAV... And save your file
That's it!!! You should now have file that is in a WAV file format :-)
If you have problems with the following just post a comment, and I'll try and help you out.
Good luck!!!
Take a look at TiMidity++

Play audio and video at a same time in iPhone application

Is it possible to play audio and video file at a same time? I want to play different audio file and video file at a same time and also want control for both, so is it possible?
Sorry, not that I know of. The movie view automatically stops all audio files and takes up the whole screen, so you are forced to listen to the audio for the video.
If the audio is part of the video file, yes.
If it's an MP3 file or some other external type how are you planning on playing it? The phone might allow this to happen depending on what you're up too.
You might be in luck soon though...
Another helpful link is here.