我们自己的应用Android的录制声音 [英] Android record sound of our own app

查看:394
本文介绍了我们自己的应用Android的录制声音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要录制音乐演奏在我app.like我玩不同的声音与声音pool.Now我想,只有的Soundpool音频记录和保存以.wav或MP3文件。我用录音来录制声音。

I want to record music playing in my app.like i am playing different sounds with sound pool.Now I want that only soundpool audio is record and save in .wav or mp3 file. I use audio record to record sound.

       AudioRecord audioRecord = new AudioRecord(AudioManager.STREAM_MUSIC,
         44100,
         AudioFormat.CHANNEL_IN_MONO,
         AudioFormat.ENCODING_PCM_16BIT,
         minBufferSize);
   int minBufferSize = AudioRecord.getMinBufferSize(44100, 
         AudioFormat.CHANNEL_IN_MONO, 
         AudioFormat.ENCODING_PCM_16BIT);

       short[] audioData = new short[minBufferSize];
  audioRecord.startRecording();

现在的音频录制,但问题是质量有点差和噪音也。
现在我坚持好心帮我。

Now audio is recording but problem is that quality is little bit bad and their is noise also. Now I am stuck kindly help me.

推荐答案

虽然我没有找到我的问题的答案,但我现在用的记录方面,我想与大家分享的技术。上述功能,我尝试使用是完全当你试图保存您的应用程序在运行时创建的音乐错误的选项。现在我的第一个版本,我只是节省了钢琴按键的点击在一个阵列系统时间一起。现在,当我播放点击它会起到相同的声音为用户尝试录制。我保存在数据库中的这些笔记进一步重用users.although这不是解决方案,因为这些票据将仅在我们的应用程序进行播放,但这是很好的功能,我们可以在我们的应用程序添加。当我解决了精确解,我将与你们分享

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 exact solution, i will share with you guys

这篇关于我们自己的应用Android的录制声音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆