Skip to content

Processing a file - help wanted #1518

Answered by garrilla
garrilla asked this question in Q&A
Discussion options

You must be logged in to vote

For anyone passing by in search of a similar solution, here's how I solved this

  1. On the Java/Kotlin side pick up the audio file (i used a WAV in this case) with an intent
  2. Use a contentResolver on the audio file to create an inputStream
  3. read the data from the inputStream into a byteArray
  4. pass the byteArray over the JNI bridge to the native code
  5. wrap the byteArray in a MemInputStream from the PARSELIB example
  6. wrap the MemInputStream in a WavStreamReader, also from the PARSELIB example
  7. create a SampleBuffer, from the IOLIB example, and load the WavStreamReader into it
  8. create SampleSource, from the IOLIB example, and give it the SampleBuffer
  9. give the SampleSource and SampleBuffer to the Simpl…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@garrilla
Comment options

Comment options

You must be logged in to vote
3 replies
@edenchisvo
Comment options

@garrilla
Comment options

@edenchisvo
Comment options

Answer selected by garrilla
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants