Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Sound Recording and Playing in Mobile Media API  RSS feed

Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to write an application to record and play voice in cellphones using Mobile Media API. My recording function is like this:
try {
// Create a Player that captures live audio.
Player p = Manager.createPlayer("capture://audio");
// Get the RecordControl, set the record stream,
// start the Player and record for 5 seconds.
RecordControl rc = (RecordControl)p.getControl("RecordControl");
ByteArrayOutputStream output = new ByteArrayOutputStream();
} catch (IOException ioe) {
} catch (MediaException me) {
} catch (InterruptedException ie) { }
I want to record the voice into a file and store it in cellphone database. How do I do that? Where do I put it in? In this example, I record from web server. That's not what I want. Voice should be an InputStream or DataSource? What is the difference between the two? I want some code examples.
Thank you.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!