Re: Access to opencore audio decoders from application layer.
Hi Sandeep, You can put the if condition in the parser to read only till 10 sec and take the PCM samples from decoder output to a file -Giri From: sandy8531 mathur...@gmail.com To: android-framework android-framework@googlegroups.com Sent: Thursday, 16 July, 2009 12:46:10 PM Subject: Access to opencore audio decoders from application layer. My application needs to extract a 10 second portion of a audio file in PCM format and store it. On other platforms I have been doing this in Java using Jlayer decoder, but once I ported that to Android, it ran extremely slowly. It takes almost 50 seconds to decode a 10 second sample ! Since the opencore libraries are already available, I would like to be to use them as an alternative. I have been looking at it for a couple of days now. I would like to understand what options are available to me to be able to do this. My first approach was to develop a JNI stub and try and make a call out to the codec in the opencore shipped library, but it appears that those interfaces are subject to change and there is no guaranty of backward compatibility in a future release. The other approach I can think of is to take the opencore source and compile the codecs into a separate standalone jni library private to my application, and that way I avoid the backward compatibility issue. Before I go too far down any path I would like to run this by the experts and figure out what is the best approach. One more question - I saw in the opencore code that the decoding thread is run at a higher priority. Since my decoder would be running at normal application priority am I going to see a significant performance drop off ala Jlayer ? -thanks, Sandeep See the Web#39;s breaking stories, chosen by people like you. Check out Yahoo! Buzz. http://in.buzz.yahoo.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups android-framework group. To post to this group, send email to android-framework@googlegroups.com To unsubscribe from this group, send email to android-framework+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-framework?hl=en -~--~~~~--~~--~--~---
Re: Access to opencore audio decoders from application layer.
Can you be more precise about what your application does? On quite a few devices (and especially on the Dream/G1) Android fits tightly with little room to spare, so it's unclear that we'd be accepting contributions for entirely new applications. JBQ On Thu, Jul 16, 2009 at 12:16 AM, sandy8531mathur...@gmail.com wrote: My application needs to extract a 10 second portion of a audio file in PCM format and store it. On other platforms I have been doing this in Java using Jlayer decoder, but once I ported that to Android, it ran extremely slowly. It takes almost 50 seconds to decode a 10 second sample ! Since the opencore libraries are already available, I would like to be to use them as an alternative. I have been looking at it for a couple of days now. I would like to understand what options are available to me to be able to do this. My first approach was to develop a JNI stub and try and make a call out to the codec in the opencore shipped library, but it appears that those interfaces are subject to change and there is no guaranty of backward compatibility in a future release. The other approach I can think of is to take the opencore source and compile the codecs into a separate standalone jni library private to my application, and that way I avoid the backward compatibility issue. Before I go too far down any path I would like to run this by the experts and figure out what is the best approach. One more question - I saw in the opencore code that the decoding thread is run at a higher priority. Since my decoder would be running at normal application priority am I going to see a significant performance drop off ala Jlayer ? -thanks, Sandeep -- Jean-Baptiste M. JBQ Queru Android Engineer, Google. Questions sent directly to me that have no reason for being private will likely get ignored or forwarded to a public forum with no further warning. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups android-framework group. To post to this group, send email to android-framework@googlegroups.com To unsubscribe from this group, send email to android-framework+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-framework?hl=en -~--~~~~--~~--~--~---
Re: Access to opencore audio decoders from application layer.
You might want to take a look at SoundPool class and its corresponding implementation in native layer, which could be a good reference if the class itself doesn't satisfy your needs:) http://developer.android.com/reference/android/media/SoundPool.html On Thu, Jul 16, 2009 at 3:16 PM, sandy8531 mathur...@gmail.com wrote: My application needs to extract a 10 second portion of a audio file in PCM format and store it. On other platforms I have been doing this in Java using Jlayer decoder, but once I ported that to Android, it ran extremely slowly. It takes almost 50 seconds to decode a 10 second sample ! Since the opencore libraries are already available, I would like to be to use them as an alternative. I have been looking at it for a couple of days now. I would like to understand what options are available to me to be able to do this. My first approach was to develop a JNI stub and try and make a call out to the codec in the opencore shipped library, but it appears that those interfaces are subject to change and there is no guaranty of backward compatibility in a future release. The other approach I can think of is to take the opencore source and compile the codecs into a separate standalone jni library private to my application, and that way I avoid the backward compatibility issue. Before I go too far down any path I would like to run this by the experts and figure out what is the best approach. One more question - I saw in the opencore code that the decoding thread is run at a higher priority. Since my decoder would be running at normal application priority am I going to see a significant performance drop off ala Jlayer ? -thanks, Sandeep --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups android-framework group. To post to this group, send email to android-framework@googlegroups.com To unsubscribe from this group, send email to android-framework+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-framework?hl=en -~--~~~~--~~--~--~---
Re: Access to opencore audio decoders from application layer.
Freepine, I have looked at Soundpool, it does not solve my problem. To further clarify, I need to implement the following (pseudo code) api for my application. I do not need to play the sound. public short[] getPcmData(String audioFilename, int seekPositionInSeconds, int durationInSeconds); Where for example: audioFileName = /sdcard/somefile.mp3 ; // If I can implement this for mp3 files only that would be a good start, but if i can also do the same for AAC and other formats that would be great seekPositionInSeconds = 15 ; // The offset inside the audio file to start decoding durationInSeconds = 5; // Number of seconds of audio data starting at seekPosition to return the data for What I need is a way to invoke the opencore decoder code from my application and get the raw PCM data back. -thanks, Sandeep On Jul 16, 7:52 am, Freepine freep...@gmail.com wrote: You might want to take a look at SoundPool class and its corresponding implementation in native layer, which could be a good reference if the class itself doesn't satisfy your needs:)http://developer.android.com/reference/android/media/SoundPool.html On Thu, Jul 16, 2009 at 3:16 PM, sandy8531 mathur...@gmail.com wrote: My application needs to extract a 10 second portion of a audio file in PCM format and store it. On other platforms I have been doing this in Java using Jlayer decoder, but once I ported that to Android, it ran extremely slowly. It takes almost 50 seconds to decode a 10 second sample ! Since the opencore libraries are already available, I would like to be to use them as an alternative. I have been looking at it for a couple of days now. I would like to understand what options are available to me to be able to do this. My first approach was to develop a JNI stub and try and make a call out to the codec in the opencore shipped library, but it appears that those interfaces are subject to change and there is no guaranty of backward compatibility in a future release. The other approach I can think of is to take the opencore source and compile the codecs into a separate standalone jni library private to my application, and that way I avoid the backward compatibility issue. Before I go too far down any path I would like to run this by the experts and figure out what is the best approach. One more question - I saw in the opencore code that the decoding thread is run at a higher priority. Since my decoder would be running at normal application priority am I going to see a significant performance drop off ala Jlayer ? -thanks, Sandeep --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups android-framework group. To post to this group, send email to android-framework@googlegroups.com To unsubscribe from this group, send email to android-framework+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-framework?hl=en -~--~~~~--~~--~--~---