Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
Background
My father has an old radio program that he loves.
It is a series of recordings done 30-40 years ago, but now he has found out that they are sent now and then as a historical retrospects. He loves them and don't want to miss a single one.
He is eager to record them so I found a little program called CoolRecord that can record from broadcast through web player. It works OK, but the problem is that there recording is done through audio card and when he uses Skype to talk to his grandchildren he always messes up sound settings and when the next recording session comes everything is chaos ....
Idea
Now I recently found out that it is possible to catch the radio stream BEFORE it passes through the audio card. This is great news! I searched and found the url to the broadcast. On http://www.listenlive.eu/sweden.html I found the following url that looks promising: http://sverigesradio.se/topsy/direkt/1602-hi-mp3.pls. It is an MP3 decoded stream with 192 kbps.
I searched the web and found several software for listening to radio and even record, but all Windows based software that I have found records audio stream after it has passed through the computer audio card ....
I actually found a freeware for Mac who does the right thing. It is called FStream but it has no Windows version ;-)
My intention is therefore to build a VERY simple program that will always connect to the same radio station and catch the stream directly without going through the audio card.
I want to keep it dead simple to my father: All he needs to do is to push a big red record button when it is time for his favorite program! No hassle with confusing audio settings, just a file automatically saved to his audio directory.
Questions
I prefer to use C#.
I guess the .Net class library has some useful methods that might help me on ....
But I have never worked with radio streaming and broadcast technology.
1) How do I set up a "stream listener"?
2) Is it possible to detect program title and automate the recording start/stop?
3) How do I save the stream to a MP3 file? Do I need to add headers etc?
4) Do I need to take care of possible interrupts in the streaming?
Have a look at streamripper. It seems to be doing what you're trying to achieve and is also available on windows. It also seems to be generating separate mp3s automatically using silent marks in the audio stream if you want to.
There also exists a "dead simple" frontend to streamripper, called SimpleRipper which might be just what you need.
The latest version of NAudio added support for MP3 streams. It's a very mature audo management library for .NET that is easy to work with.
You can stream the incoming buffer into most supported audio formats.
Related
I am attempting to stream a video, in a format unity3d can access, like an mjpg. I have gone through several possible solutions, including gstreamer(only does client side as far as I could tell by the examples), yawcam(I couldn't find a way to access the image directly), and silverlight(due to simply not being able to find how the heck webcam streaming was doable) I am currently just looking for any more methods of getting video over from one side to the other. Could I possibly simply read the images into a byte array and send it over a socket? Maybe I missed something in the previous three possible solutions?
If you are looking to stream video from a server than you can use Ogg encoding + WWW.movie to map it to a texture. Assuming you have a Pro license, as I think this is a Pro only feature. If this is a local file, either bundled with the app or in external folder, we use the brilliant AVPro Windows Media or AVPro QuickTime. MJPEG does offers super smooth scrubbing with AVPro but generates enormous files. Definitely not ideal for streaming or even download!
Finally RenderHead also has a Live Camera capture plugin that could meet your needs.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I'm trying to implement a progressive download audio player for the iPhone, using http and fixed size mp3-files.
I found the AudioStreamer project but it seems very complicated and works best with endless streams.
I need to be able to find out the total length of audio files and I also need to be able to seek in the files. I found a hacked deviation from AudioStreamer but it doesn't seem to work very well for me. http://www.saygoodnight.com/?p=14
I'm wondering if there is a simpler way to achieve my goals or if there are some better working samples out there? I found the bass library but not much documentation about it.
/Br Johannes
There's unfortunately nothing simple about playing audio streams on the iPhone. Here's the article that got me started:
Streaming and playing an MP3 stream
It's an OSX project, but most of it will work with the iPhone too. As for getting the full play time of it, you'd probably have to figure that out based on the content-length property of http header, provided it's a CBR file. Otherwise, I imagine you'd have to download the entire file before determining that.
If you only need to play MP3 files, why are you writing your own downloader/player? You have a few options built into iOS, each of which support progressive download and MP3 playback:
MPMoviePlayerController
AVPlayer
Safari <audio> player
I've personally had issues with the progressive download capabilities of MPMoviePlayerController and AVPlayer, so perhaps this is your issue also. I've found that these players try to be smart by requesting the mp3 multiple times, checking to see if the server supports progressive download via http range offsets. But when the server doesn't support range offsets the file is downloaded multiple times, eating bandwidth (!).
In my latest project I embedded a UIWebView having a html <audio> tag embedded. The Safari player seems to behave better than AVPlayer and MPMoviePlayerController, but it had its own caveats as well. For one, getting autoplay to work was a PITA.
There's a really good chapter about streaming audio in iPhone Cool Projects.
http://apress.com/book/view/9781430223573
It shows a simpler approach then AudioStreamer (Using NSURLConnection instead of CFNetwork), better suited for progressive downloading, and no multi threading code.
And for finding out the size of the audio file you can use [response expectedContentLength] in
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
I know this is a rather old post, but wanted to suggest a solid library that is open source. It is based on Matt Gallagher's original post recommended by #pzearfoss above. The current version uses AudioUnits now, rather than the AudioQueue classes, so it gives you access to the raw PCM samples for any manipulation you want to make (filtering, etc.) before playback. It also gives you progressive download capabilities for free, with rather minimal effort. The library seems to be actively updated which is a huge plus!
StreamingKit by #tumtumtum
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I'm making an iphone game, currently using openAL for SFX, we want to keep the game under 10 meg.
iphone (through openAL atleast) only natively plays uncompressed PCM.
What would be the most straightforward way of getting music from some sort of good compressed format (mp3, aac, ogg etc) into my game?
Is there some sort of decoder api? should I be using openAL?
EDIT:
OK, we've done some calculations, and we should be able to fit everything in nicely with a simple 64kb/s compression scheme, so I'm looking for the easiest way to decode a compressed file (preferably from memory) to raw pcm in memory for use with open al. we will also need a streaming decoder, it is not necessary for it to be able to decode the stream from memory, but it would be nice. We want to put looping in for the track, so it would be ideal if the decoder had “random access” so you could move around the track easily.
The most compressed way would be a tracker or MIDI. That lets you store only the score for the music, not sound samples.
Maybe this is what you're looking for.
Another option would be to compile an open source synth/sampler in your game, and communicate a MIDI player to the synth samples/sounds, that could give you really good music ( I am a Software Engineering student and almost studied music ( 15 years of Piano/Synths etc ), that could be a bit more complex, BUT, can give you awesome sounds being played by the synth with light weight MIDI tracks to trigger the synth sounds.
Good luck, and I think this is actually a really nice ( a bit more complex maybe ) , way to go!
Ok, I've just got it all set up.
I used Audio Queues for the music stream simply because it is the ONE part of the iPhone SDK that is well documented:
http://developer.apple.com/iphone/library/documentation/MusicAudio/Conceptual/AudioQueueProgrammingGuide/AboutAudioQueues/AboutAudioQueues.html#//apple_ref/doc/uid/TP40005343-CH5-SW1
for the general explanation and
http://developer.apple.com/iphone/library/documentation/MusicAudio/Conceptual/AudioQueueProgrammingGuide/AQPlayback/PlayingAudio.html#//apple_ref/doc/uid/TP40005343-CH3-SW1
for a great example (that is a bit buggy)
this seems to work fine along side openAL. and it does seem that it will allow us to jump randomly about the stream at a sample level of accuracy.
the only remaining thing to do is get it so we can load from memory, this is done by replacing the:
AudioFileOpenURL
Call with a call to:
AudioFileOpenWithCallbacks
Unfortunately the documentation for the Audio File Services is... poor... to say the least.
read it at your own risk, and then after it inexplicably doesn't work read:
http://developer.apple.com/iphone/library/qa/qa2009/qa1676.html
where it tells you that the callbacks are actually optional, and by supplying a write one you are telling it to open the file for writing which it can't do for MP4s, so just pass NULL for the write and setSize callback.
I would also like to say that the two answers here recommending MIDI are almost certainly the right way to go if you really want the smallest size.
Unfortunately we are lazy and just wanted something in quickly, it also came to light that we could fit in moderately compressed audio. I was also slightly worried about the performance implication (I don't know what that would be for midi) but apparently this method for compressed audio here uses hardware decoding.
If you want to go the traditional compressed audio route hopefully this helps, you could also try the Audio Converter Services if you want to use the data with openal, unfortunately this API also falls into the embarrassingly poorly documented reference manuals. I don't even know if it works, and if it does, I'm not sure if it uses the hardware decoders.
I am developing an application in which I want to record the sound of a piano key press. I'm not able to find anything relevant on the internet which helps.
Can anybody share the code or any link which shows how to record the data of the piano key press, store it somewhere in memory and then play it again?
or
If anybody knows how to get the key press event of the keyboard and record it, that would also be appreciated.
Thanks,
Mishal
It sounds like your particular need does not involve MIDI or capturing notes from a digital piano, if I am reading correctly. You want just the audio sound of a piano, to play back on an iPhone app?
A few questions/thoughts:
First, do you just need one note/sound? If so you should be able to easily find a sound file that is to your liking on a site that sells sound samples. I myself use sounddogs.com for various odd projects.
Next, what sort of code do you need to play the sound? What programming language are you developing the app in and how do you trigger the sound playback? These details will be helpful in giving you some ideas.
Finally, if the main obstacle is just finding and recording the sound, this question may be better moved to superuser.com since that site deals more with general computer questions, media, and technology. (StackOverflow is focused strictly on programming.)
I'm wondering if there are any examples atomic examples out there for streaming audio FROM the iPhone to a server. I'm not interested in telephony or SIP style solutions, just a simple socket stream to send an audio clip, in .wav format, as it is being recorded. I haven't had much luck with the google or other obvious avenues, although there seem to be many examples of doing this the other way around.
i cant figure out how to register the unregistered account i initially posted with.
anyway, I'm not really interested in the audio format at present, just the streaming aspect. i want to take the microphone input, and stream it from the iphone to a server. i dont presently care about the transfer rate as ill initially just test from a wifi connection, not the 3g setup. the reason i cant cache it is because im interested in trying out some open source speech recognition stuffs for my undergraduate thesis. caching and then sending the recording is possible but then it takes considerably longer to get the voice data to the server. if i can start sending the data as soon as i start recording, then the response time is considerably improved because most of the data will have already reached the server by the time i let go of the record button. furthermore, if i can get this streaming functionality to work from the iphone then on the server side of things i can also start the speech recognizer as soon as the first bit of audio comes through. again this should considerably speech up the final amount of time that the transaction takes from the user perspective.
colin barrett mentions the phones and phone networks, but these are actually a pretty suboptimal solution for asr, mainly because they provide no good way to recover from errors - doing so over a voip dialogue is a horrible experience. however, the iphone and in particular the touch screen provide a great way to do that, through use of an ime or nbest lists for the other recognition candidates.
if i can figure out the basic architecture for streaming the audio, then i can start thinking about doing flac encoding or something to reduce the required transfer rate. maybe even feature extraction, although that limits the later ability to retrain the system with the recordings.