Streaming mp3 data

Hi and thanks in advance to anyone willing to help out :)
I was disappointed by the general lack of quality in every single J2ME app out there for listening to internet radio (and I'm not going to pay for something so simple), so I decided to have a go at it myself. I found out I could just use Manager.createPlayer() and pass the URL of the stream to it, and it would (I assume) play the stream without any problems.
Now, the problem is that I want to parse and display metadata. In ShoutCast radio, a simple metadata block is inserted into the mp3 data at a certain interval specified by the server. This makes it fairly simple to read the metadata, however it means that passing the stream straight to the mp3 decoder will cause a glitch in the sound every second or so, so if I want metadata, I have to modify the stream before playing it.
I thought this should be simple to do but it seems it isn't. I have been unable to locate a way to send data directly from a buffer in my application to the mp3 decoder for playback. The closest I think I got was creating a Player from an InputStream; this way after jumping through some hoops it seems to be possible to play audio from a buffer created by the app itself, but once it's finished playing I would have to destroy and re-create the Player in order to play the next chunk of sound. This would be extremely impractical and I doubt it would allow seamless playback of the stream, since it would have to interrupt playback everytime a block of metadata is received (which happens all the time, not just at song changes).
So basically, my question is: is there a way (and if yes, what is it) to continously play audio, from my own data buffer?
Thank you very much for your help! :)
- dm from Hungary

The Harman-Kardon manual for the DPR1005 has this to say about sending raw MP3 data to the unit:
The MP 3 DSP mode found in the new DPR
requires an MP3 SPDIF stream. Presently, only a
few units provide this but in the coming generations
of motherboards and operating system
updates this will follow, since SPDIF is the standard
for audio & video hardware.
All the information I have found regarding this topic leads me to believe that that the iMac can not send raw data via the SPDIF output.
However, Squeezebox can - http://www.slimdevices.com/pi_specs.html#outputs
That is the only device I have successfully located that will stream MP3 data via optical, not just standard pcm.

Similar Messages

  • Capture streaming MP3 to file

    Is there a way to open an MP3 stream and write it to a file? A java based way to record internet radio for later listens?

    1) Can someone point me to a URL where if I connect it will send me streaming MP3 data?No. I mean, I could make a URL that sends you MP3 data, but it'll only be what I want to send, not necessarily what you want.
    The file you get is a meta file, which tells where the content is. If you want to connect to that, you need to know what the protocol is. If it's not publicly available, then I'm sure a reasonably motivated person could sniff it out. And that's presuming that the audio is actually MP3 data to begin with.
    2) Is there a better way of doing this?That depends. Better for who? You the application developer? The end user? The copyright owner?
    Back to your original questions, which were actually reasonable...
    Is there a way to open an MP3 stream and write it to a file? If you have an MP3 stream, it's either a TCP or UDP stream, in which case, yes, you can have Java connect and record it, presuming you can talk to the server in the appropriate protocol that the server expects to be talked to in.
    A java based way to record internet radio for later listens?This is entirely up to the radio protocol.
    You'd probably be better off intercepting the raw audio from the sound card, as it's more universal.

  • Using CAN bus to transport and play the stream audio data

    hello,
    Just want to build a PC-Based control network using CAN bus (Ethernet not considered).The system is separated two parts , one is the front unit(FU), and the other is the centeral unit(CU). FU performs dialing-up number to the CU , and play the stream audio media data come from CU, CU monitor the telephone call activated from FU's user , send rm or mp3 data to the FU . I'd like to know if CAN bus could realize this function? if it can , which hardware must be supplied ? Is there any suggestion that not use PBX to realize the voice (telphone) communication ? Please give an solution , your advise is greatly appreciated . Thanks.
    David

    Hi David,
    the CAN protocol essentially just gives you the ability to transfer (broadcast) up to eight data bytes across the network at a maximum data rate of 1 Mbit/s.
    There are so-called higher level (or layer) protocols that further specify the data exchange between a data producer can the consumer (DeviceNet, CANopen, etc.).
    If your application is not tied to any of those protocols, that means you have the freedom to design all (CAN) nodes of your network, you can implement your own protocol based on the eight data bytes and the arbitration ID CAN offers.
    For more information on the CAN protocol, take a look at appendix B of the NI-CAN Hardware and Software Manual, or visit the web site of CAN in Automation (CiA).
    For your particular application you would need a CAN port on both the FU and the CU (preferably high-speed physical layer) and a PCI interface CAN card for you development.
    -B2k

  • Streaming MP3 with RTP

    Hello,
    I am trying to implement a RTP server and a RTP client, for that purpose I am using JMF, it seems to work good until I tried to transmit MP3 files. When I trasmit MP3, I get the next error message:
    Unable to handle format: mpeglayer3, Unknown Sample Rate
    Failed to realize: com.sun.media.PlaybackEngine@1700391
    Error: Unable to realize com.sun.media.PlaybackEngine@1700391
    Error in ControllerErrorEvent: javax.media.ResourceUnavailableEvent[source=com.sun.media.content.unknown.Handler@fa39d7,message=Failed to realize: input media not supported: mpeglayer3 audio]
    I have installed the mp3 pluging and I have used the AVTrasmint2 and AVReceive2 class with some modifications to try to solve the problem, but I can not solve it.
    I tried to use JMFStudio in both sides (server and client side) and I got the same error.
    -->failed to handle a data format change!
    I would like to add that I have used two differents computers (one for the server and one for the client) to make all the test.
    Could you give me some advise, help or solution for that problem? If someone has a solution(code) to transmit streaming MP3 using RTP and kown that it is running ok, could you show me?
    I am doubting if MP3/RTP is supported in JMF, If someone knows another alternative to implement a streaming MP3 audio server and client, could you say me what solution is it?
    Thank you very much, I expect that someone could help me.
    PD: Sorry for my english, I think that it is not so good.

    Hi I had the same problem but i manage to solve it.
    First of all you have to install the mp3 plug-in and as u mentioned that u already did that.Make sure the mp3plugin.jar file is inside the lib/ext of the jre you are using for your project and one imp thing is first register the plug-in by issuing the command
    java com.sun.media.codec.audio.mp3.JavaDecoder
    It will modify the jmf.properties binary file.Once your done with this put this updated jmf.properties file in your project folder.After this your code should run perfectally.In case of any problem.Post it.
    cheers

  • Streaming mp3 through Oracle/RealServer plugin

    Did anybody try to stream mp3 content from Oracle database through Oracle interMadia plugin for RealServer8? The RealServer8 itself plays mp3 files with no problem. I am having no problem to play native RealServer content (loaded from *.rm files) trough the Oracle plugin (mime_type='audio/x-pn-realaudio'). I am using mime_type='application/x-pn-mpg' as recommended when loading mp3 in ordaudio object. But the RealSetver says that 'This server is not configured to play the data type you requested'. What is wrong? My environment: Oracle plugin 8.1.6/8.1.7 for RealServer for Solaris.
    Thanks for your input,
    Eugene.
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Eugene FIRYAGO ([email protected]):
    Did anybody try to stream mp3 content from Oracle database through Oracle interMadia plugin for RealServer8? The RealServer8 itself plays mp3 files with no problem. I am having no problem to play native RealServer content (loaded from *.rm files) trough the Oracle plugin (mime_type='audio/x-pn-realaudio'). I am using mime_type='application/x-pn-mpg' as recommended when loading mp3 in ordaudio object. But the RealSetver says that 'This server is not configured to play the data type you requested'. What is wrong? My environment: Oracle plugin 8.1.6/8.1.7 for RealServer for Solaris.
    Thanks for your input,
    Eugene.<HR></BLOCKQUOTE>
    null

  • Save streamed MP3 file?

    Our app includes a music player which streams MP3s from a server. We would like to be able to stream the MP3, and save it to a cache on disk once it has fully downloaded.
    I am using the load() method of the Sound class to stream the MP3 so that playback can begin before the file is fully downloaded. I can listen for the Event.COMPLETE event to indicate that the MP3 has finished downloading, but the Sound class offers no way to access the original file and save it to disk (the extract() method returns uncompressed sound data which is much too large to write to the disk).
    Is there any method to download an MP3 file that will allow us to stream the MP3 file as it is downloading, and save it to disk when the download is complete, without downloading it twice?

    Unless you can find an MP3 encoding library that could take the extract() data and convert it back with minimal effort, I think your only option is to save the mp3 using the File and FileStream classes. One thing you could try is to use a File object to download the file, and while it is downloading, you have the sound object play the data contents of the File object downloading the mp3. I just tried a quick test locally and it worked on my desktop. You will have to try it from an actual server to know how well it can work in that environment, but it is at least worth a shot.
    import flash.filesystem.File;
    import flash.filesystem.FileMode;
    import flash.filesystem.FileStream;
    import flash.events.ProgressEvent;
    import flash.events.Event;
    import flash.media.Sound;
    import flash.net.URLRequest;
    var file:File = File.applicationDirectory.resolvePath("gravity.mp3");
    file.addEventListener(ProgressEvent.PROGRESS, onProgressEvent);
    file.addEventListener(Event.COMPLETE, onFileLoadComplete);
    file.load();
    var sound:Sound;
    function onProgressEvent(e:ProgressEvent):void {
      if (sound == null) {
      file.removeEventListener(ProgressEvent.PROGRESS, onProgressEvent);
      sound = new Sound(new URLRequest(file.url))
      sound.play();
    function onFileLoadComplete(e:Event):void {
      file.removeEventListener(Event.COMPLETE, onFileLoadComplete);
      var saveFile:File = File.desktopDirectory.resolvePath("gravity2.mp3");
      var fs:FileStream = new FileStream();
      fs.open(saveFile, FileMode.WRITE);
      fs.writeBytes(file.data, 0, file.data.length);
      fs.close();
    What this code is doing is creating a File object with, in this case, a path to an MP3 in the same folder as the test FLA I created. This would be a path to your server stored MP3. Then you setup the event listeners for progress and complete. I used progress to know that the file had actually started to be downloaded to then trigger the initialization of my Sound object. Depending on someones network connection and the size of the MP3, it could be a good idea to use progress to know that the file has gotten X percentage done before trying to play the file.
    For testing purposes in my progress event, I just checked to see if the Sound object had been initialized yet, and if it hadn't then set sound equal to a new Sound object with the File.url property for the URLRequest() and then told it to play.
    Once the File object dispatched the complete event to indicate that the download finished, I created a new File object for the purpose of saving it to the filesystem using the FileStream class. Using FileStream to save the file allows for no user interaction to save the MP3.
    There may be better ways to handle my method, but I can't think of any at the moment. As far as I know, the second File object, which I named "saveFile", is required in order to actually save the downloaded MP3 object because Im not too familiar with File manipulation. The only downside I can think of is that you have a copy of the MP3 is memory and would need to null out the File object that loaded the MP3 to free up memory.

  • AIR for Android: Streaming audio data won't stop unless I quit....

    I write an application (AIR-Android with Flash Builder) which can play internet radio stations (streamed audio in mp3).
    When I want to stop the stream like myChannel.stop() / mySound.close(); the sound is stopping but the stream is still loading (I can see it with a network monitor app).
    Streaming audio data won't stop unless I quit the application or I switch my connection from WIFI to 3G or from 3G to WIFI.
    I do not have this problem with Air for Mac and IOS.
    How can I solve this problem ?
    Bernard

    Hi Chris,
    I received a response from a certain Wang Zhe (from Adobe) about this bug.
    https://bugbase.adobe.com/index.cfm?event=bug&id=3070987
    It should provide an example of his test that apparently it worked but I have still no answer from him.
    Is it possible to contact him directly?

  • Streaming MP3s

    Hi all,
    I am trying to stream mp3 using JMF and RTP, however I am getting an error at the receiver saying:.
    RTP Handler internal error: javax.media.ControllerErrorEvent[source=com.sun.media.content.unknown.Handler@183f74d,message=Internal module com.sun.media.BasicRendererModule@1386000: failed to handle a data format change!]I have installed the mp3 plugin and the mp3 does play locally using a simple JMF player. The Stream is also being transmitted properly because I was able to play it using VLC player. I can post my code if needed.
    Please, please, please could someone help me or suggest a better way than JMF for streaming audio in any language.
    Thanks

    I have found the answer. MP3's cannot be streamed under the format MPEG.It cannot be decoded, however, DVI can + others on:
    http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/formats.html
    The quality is shit, but for voice or other purposes it should be fine.
    Cheers anyway

  • Streamed MP3 music files losing first few seconds

    My Apple TV seems to drop the first few seconds of MP3 music files when they are streamed from iTunes, but not when they are synced to the Apple TV.
    The number of seconds that are dropped varies from none at all for some songs to 20, or much more than that ... but seemingly never more than a minute.
    When I select one certain song in a particular playlist -- "Song for the Mira" by the Garrison Bros. -- the time shown is 5:19. When I press play on the Apple TV remote the time changes to 5:00, very briefly ... just before the Apple TV starts to play the song with its first 19 seconds missing, as if it were really a 5:00 song.
    From that time on (unless I reload the iTunes library) every time I select the same song from any playlist, or from under Songs, or Albums, or whatever, the time is always shown right away as 5:00. So Apple TV is "remembering" the time of the song.
    If I cause Apple TV to reload that iTunes library, the time goes back to 5:19 until I actually play the song again, at which time it becomes 5:00 again.
    The amount of time that is sliced off from the beginning of a song is always consistent for that song. So if the amount is 12 seconds one time for a particular song, it is always 12 seconds.
    I have not altered the start or end points of affected songs in iTunes.
    As far as I can tell, this never happens with Protected AACs.
    It never happens with synced copies of the MP3s, only with streamed playback.
    I have the latest versions of iTunes (7.3.2) and of the Apple TV software (1.1).
    Restoring the Apple TV to factory settings, re-downloading the software, etc., have no effect on the problem. Nor does restarting my iMac, which is running OS X 10.4.10. Nor does restarting the various base stations on my wireless network, all of which have the latest firmware.
    Anyone else have a problem with the beginnings of streamed MP3s being truncated? Anyone know what to do about it? Thanks.

    Since my last post to this thread I have discovered:
    (1) I was wrong in thinking there is no pattern to the number of seconds lopped off at the beginning of various MP3s when streamed to my Apple TV. Actually, I have found that the same number of seconds is dropped from every song in a particular album or compilation!
    So my "Sounds of Nova Scotia, Vol. 1" compilation -- which contains the "Song for the Mira" that is reduced from 5:19 to 5:00 at the start of Apple TV's streamed playback -- has 19 seconds removed at the start of every track when its tracks are streamed to Apple TV. (It does not appear to be significant that this particular track seems to be rounded to the nearest minute. Cutting the first 19 seconds off the other tracks in the compilation does not bring them to an even minute.)
    My Beatles' "Abbey Road" album has not 19 but 30 seconds dropped at the start of every streamed track!
    (2) I was also wrong in reporting that the time change from, say, 5:19 to 5:00 is "remembered" by Apple TV the next time I select the affected track from a list on the TV screen. Actually, the next time I select the track, it shows up as 5:19 again. But if I press Play, that changes to 5:00 in the split second just before the track actually starts to play ... and then the progress bar that appears at that point, when the actual song is being played, reflects a 5:00 total time, not 5:19.
    To recap what I said before, this happens only when I stream (even from the syncing iTunes), not when I play a synced copy. AACs are unaffected. Not all MP3s seem to be affected, though all in an affected album or compilation are affected the same way, by having an identical number of seconds lopped off. I have the latest software/firmware in all my devices. Restarts/resets do not help. The problem persists in copies of copies of the affected MP3 tracks streamed from iTunes _on my other Mac_, a MacBook Pro. The problem does not occur when I play the tracks right in iTunes on either machine. I am not using manually set start and stop times on the affected tracks in iTunes. I do not have *Part of a Gapless Album* or *Remember Playback Position* set in Info in iTunes Preferences, though I have tried setting *Part of a Gapless Album*, with no effect on the problem.
    Anyone have any more ideas as to what might be causing this? Thanks.

  • Problems streaming mp3's

    Hi,
    I'm having some trouble with streaming mp3's and clicking
    links at the same time. It seems that while the mp3 file is
    downloading it's impossible to click on links, it freezes until the
    song is fully downloaded. To view the mp3 player i've built with a
    friend please feel free to visit
    http://www.musicplayer.fm/ -
    if you sign in with username: "test" password: "password" and feel
    free to play any song, and you'll see what i mean. I'm stuck
    getting around this problem.
    I've tried embedding the player using the SWFobject method in
    javascript, cross domain streaming... and nothing seems to work.
    The player is streaming the mp3 using loadSound(location, true);
    and the location is fed using an xml file.
    Thanks for any advice in advance.
    Matt

    No surprise at all - these are two different technologies for two entirely different purposes.
    A podcast is meant for files to be downloaded to a user's computer so that they can be listened to at any time or transfered to an iPod. A streamed file is more like a radio broadcast - it can only be listened to while the streaming server is "broadcasting" the file to the client computer.
    If you want to take advantage of both options you'll need to upload your file to two different locations.

  • Stop/Start Streaming Mp3 Sound- Button Script

    I'm looking for a button script to stop a streaming mp3 sound
    playback on the first click, then start it again on the second
    click and so on.

    You need brackets after the function call...
    playMusicFunc();

  • Stream mp3 without FMS?

    is it possible to stream mp3 without using FMS? how would I
    do it? All the examples I could find and the examples in the book I
    bought show streaming done via rtmp and a flash server. My website
    is located on a shared webserver, so I'm not sure I can install
    FMS.
    I'm trying to write an embedded mp3 player that can play a
    song. when a link is clicked the link should pass the song name so
    the player will play the correct song. for example: when
    http://mysite.com/player.php?value=songname.mp3
    is clicked, the player will play songname.mp3
    thanks.

    I'm surprised that no one has answered this. Is this question
    too simple or something?
    Anyway, I've been trying to load an mp3 at runtime but I'm
    getting some errors:
    Error: Could not resolve <mx:Sound> to a component
    implementation.
    <mx:Sound id="bgm" source="01.mp3"/>
    how can i implement loading the sound file?
    here's what i've currently put together... I know there's a
    lot of mistakes, but that's why it's not compiling right? :-) hope
    someone can give me a hand with this.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml">
    <mx:Style>
    Button {
    color: blue;
    .play {
    color: black;
    upSkin: Embed("playup.png");
    overSkin: Embed("playover.png");
    downSkin: Embed("playdown.png");
    .stop {
    color: red;
    upSkin: Embed("stopup.png");
    overSkin: Embed("stopover.png");
    downSkin: Embed("stopdown.png");
    </mx:Style>
    <mx:Panel id="panel" width="450" height="64">
    <mx:Button styleName="play" label="Play"
    click="bgm.play()"/>
    <mx:Button styleName="pause" label="Pause"
    click="bgm.pause()"/>
    <mx:Button styleName="stop" label="Stop"
    click="bgm.stop()"/>
    </mx:Panel>
    </mx:Application>

  • Streaming large data to client

    Hi Friends,
    Need some help.
    I have to generate a pdf on fly and stream to client over internet, but the size of pdf might be 100 MB, and I think streaming this much data over network is not good. Moreover if user is on a dial up it will take too long for user to download the pdf. I cannot stream the data in any other format, I have to stream it as a PDF.
    Do you guys have any suggestions to handle this situation?
    Any help is really appreciated.
    Thanks,
    BS

    Hi Thanks for your reply.
    "Then provide him with a link to a servlet that will read the file and send it back to him."
    When reading this file, if it is huge still we have the same network and user's download speed issues, correct me if I am wrong.
    Generally how do you stream huge files to client, I am sure it is not a new problem, but I never encountered this before. Moreover, what are options for generating read only files.
    My requirement is to generate read only memo's and user wants to generate several memos at once.
    Please do let me know if there is another way to handle this requirement.
    Thanks.

  • Stream mp3s in safari

    I was able to stream mp3s from safari and navigate away from the safari app with the mp3 still playing in the background. Now for some reason I am unable to do that. It stops playing when I hit the home button or if my phone locks. How do I fix this? Again, it was working earlier today.

    Hi Dan
    http://www.rubicode.com/Software/RCDefaultApp/ claims to allow a user to modify the launchservices database in a nice easy way.
    Using defaults read com.apple.launchservices ( take great care using Terminal !! ) may give some clues too.

  • Playbook Won't Stream mp3 In Browser

    I have a site that hosts a lot of mp3's.  When I log into the site through the browser and click on any of the mp3 files, I get a "Media Error" and some message about an 'unsupported file type'.  Is there something that needs to be turned on in the browser or some 'add on' I need to successfully stream these mp3's?  I didn't think this was going to be such a problem.  Thanks in advance.

    Same problem here - it would be nice if there were a simple fix or plugin for this.
    Cannot stream MP3 from Synology NAS server or Sirius Satelite player (Online)
    http://mp.siriuscanada.ca/sirius/ca/servlet/MediaPlayer

Maybe you are looking for