I am developing an application with some buttons in it. When a button touched, the application play a sound with SoundPool method. Is there anyway to record the sequence of sounds that user plays and save it to a file? Thanks in advance.
Asked
Active
Viewed 977 times
2
-
No, there isn't. But you could take the same data that you have in your SoundPool and write it to a file at the same time as you play it (might require some decoding and encoding on your app's part). – Michael Mar 23 '13 at 11:17
-
@Michael Thanks for your comment. – Mahdi Jafarzadeh Mar 23 '13 at 11:23
1 Answers
3
Sure thing, as you already have OnClickHandlers
on the Buttons, and you call SoundPool
from there, simply add a line of code that stores the event in some List
...

Goddchen
- 4,459
- 4
- 33
- 54
-
This is possible but when application supports multitouch it seems too complex. – Mahdi Jafarzadeh Mar 23 '13 at 11:38
-
what's the problem with multitouch? Your `OnClickListener` will be called normally... – Goddchen Mar 23 '13 at 11:42
-
The problem is when user touches two(or more) buttons Simultaneously. I think saving these sounds is complex. isn't it? – Mahdi Jafarzadeh Mar 23 '13 at 11:54
-
1Ah i thought you only want to save the event and not the sound... Well, how about really only saving the event (with timestamp and which sound was played) and later generating the output audio file with some library or tool? Saving the events with multitouch shouldn't be a problem. – Goddchen Mar 23 '13 at 11:56
-
Sure. saving the events is a good way but I don't have any idea to make output audio. – Mahdi Jafarzadeh Mar 23 '13 at 12:01
-
1maybe this post will be of any help? http://stackoverflow.com/questions/12568326/merge-two-audio-filesnot-concat-in-javaapi – Goddchen Mar 23 '13 at 12:07