I am developing a musical piano app for android, in this app i want to record sound which user play by clicking piano buttons. I am using soundpool to play piano sounds. now for recording android gave us two api's MediaRecorder and AudioRecorder. but for both we have to set MediaRecorder.AudioSource. i didn't want to record sounds from mic because user sound can be included and more important sound quality decrease in recording. then i try to read bytes of that resource file which is played on clicking piano app. and when user click again and again then bytes will be together in global byte array. but when i play global byte array then this play only one resource file and one time only.
More important thing is i am new to android development. kindly guide me.
Although i did not find answer of my question, but now i am using technique for recording aspects which i want to share with all of you. Above function which i try to use is totally wrong option when you are trying to save music created by your app at run time. now for my first version i just saving the clicks of piano buttons along with system time in an array. now when i play that clicks it will play same sound as user try to record. i save these notes in database for further reuse by users.although this is not solution because these notes will be played in our app only, but this is good feature which we can add in our app. when i solve the correct solution, i will share with you guys
Related
for an exam project i'm programming a 1 octave playable midi keayboard on phone.
I managed, thank to things found here on SO, to make the keyboard work but i have no clue on what i can do to record what I'm playing.
I should be able to play a melody ( record it by pressing a button, i guess) and save it on a folder as a .mp3 file. Is that possible by not using the device microphone or is it indispensable?
at the end, i made it by recording a plain file with byte data where every byte is an object of tipe "record" that is called by the midi controller that plays the note, with it it's saved the duration of all the notes, so when you open the file 'recorded' by the midicontroller it pays the note you recorded with the same timing you played them first.
i can share code if anyone is interested.
I'm building a custom device. It runs android(rooted/configurable).
What I want to do is this: when my device is paired to your phone, it can accept/reject calls, control music(Volume +/-, next song, play/pause etc).
I don't want the audio. The audio plays from your phone itself. I just want to control the calls and the music. I have been reading up a lot on Bluetooth and profiles. And I'm not sure if there is a right one out there for me. Also it would be more helpful, if i can do all these functions without an app. That is i just pair the devices and they work. Hoping someone can help me whit this.
Im a new developer with 2-3 months of experience in android app development
I wanted to ask about is there a way to pop up a notification on a specific time or do anything!. I want to play a audio file on a specific time without clicking any button in the app or doing anything. For example : Muslim Pro in that app the prayer audio file is played on a specific time. I want to implement that functionality
Can you please explain to me how to do it?
I'm on the way to implement the Cloud Backup of progress that player achieved in the game so Saved Games function provided by Google Play Services looks like what I need.
After reading this documentation page about Saved Games I realized that it is not exactly what I need. Following the guide I have to show the new Activity for user where he's saving/loading the game progress, but I dont want to do that.
According to my idea no additional activities should be displayed, I want to do this on the background as non-visible for player task. Is there any way to do this the way I want?
I would appreciate any ideas. Thank you.
I think Google Play Games support automatic saving and loading. According to this video: Game On!: Cloud Save
7:26 of the video:
"the game does save to the cloud automatically"
and 7:55 of the video:
"And I'm just going to force a Cloud Load here by going into the Cloud Load menu. Notice that normally this would happen automatically"
What you have read in the document is the force save and load that can be seen in the Cload Save video.
If you notice:
Loading Saved Games
To improve your game's performance, you are encouraged to perform saved game loading as a background operation rather than in the main thread. One way to do this is by using an AsyncTask and override its doInBackground() method to open the saved game.
Here are github that can help you with save games implementation:
Google Play game services - Android Samples
AutoSaveUnitySample
Google Play Games plugin for Unity
I'm writing an accompaniment application that continuously needs to play specific notes (or even chords). I have a thread running that figures out which note I need to play, but I have no idea where to begin regarding the actual playback. I know I can create an audiotrack and write a sine wave to it, but for this project a simple tone won't cut it. So I'm guessing I either need to use MIDI (can android do that?) or to somehow take a sample and change its pitch on the fly, but I don't know if that's even possible.
All I can say is to check out pitch-shifting (which you seem to have heard of) and soundpool (which would require some recording of your own) and these 2 links:
Audio Playback Rate in Android
Programmatically increase the pitch of an array of audio samples
the second link seems to have more info.