Two audio recording methods for Android
In mobile APP development, every time an APP is designed for multimedia development, many programmers will suffer, and the project development progress will slow down
And the APP testing will increase. Multimedia Development in Android
MediaRecord can be used for recording in Android, which is easy to operate. However, it is not professional enough to Process audio. If you want to process audio in real time or encapsulate the audio
You can use AudioRecord for recording.
Here is a piece of code.
-Endian integer 16-bit variant of linear PCM), and iPhone preferred file format (reminder: Core audio file format, that is, CAFF ), you can enter the following command line:
Afconvert-D lei16-F 'caff' input_file.xxx output_file.caf
Note: I didn't point out the extension of this input file, because afconvert can intelligently detect the audio file type and convert it accordingly, the
memory is 2048*1526*4 bytes, which is equivalent to 12MB of RAM, which needs to be re-erased and redistributed each time the layer is redrawn. Software drawings are expensive, and unless absolutely necessary, you should avoid redrawing your view. The secret to improving your drawing performance is to avoid drawing//vector graphics Cashapelayer Although it is efficient but the number of simultaneous layers on the screen is approximately hundreds of-(v
Mediarecord can be used for recording in Android, which is easy to operate. However, it is not professional enough to Process audio. If you want to process audio in real time or encapsulate the audio
You can use audiorecord for recording.
Here is a piece of code.
Method 1:UInt32 Audioroute = Kaudiosessionoverrideaudioroute_speaker; Audiosessionsetproperty (Kaudiosessionproperty_overrideaudioroute, sizeof (Audioroute), audioroute);Method 2:[[Avaudiosession sharedinstance] Setcategory:avaudiosessioncategoryplayback Error:nil];Solution for Audiosessioninitialize Fail (dispatch_once_t) Solution Audioqueuestart failed (-50)
The
audiosessioninitialize can be executed multiple times, but Audiosessioninterruptionlistener can only be set once, which m
This article was reproduced from: http://www.jb51.net/article/82281.htmThis article mainly describes the Android app call Mediarecorder implementation of the recording function instance, Mediarecorder is very powerful, not only can be used to record audio can also record video, the need for friends can refer to the nextMediarecorderAndroid Mediarecorder contains
buffer size parameter should be a multiple of the minimum buffer, depending on the specific requirements, sometimes factors such as network latency can also affect the buffer size.You should avoid using an empty buffer at all times, because it can cause playback to fail.The last parameter determines whether to send only one audio data (mode_static) or a continuous send data stream (Mode_stream). The first case involves sending the entire
Document directory
Hero's invention syndrome
After receiving the book "App Store wins: money secret developed by Apple" sent by CSDN, we probably read most of the content. There are still many gains.Title
The full name of this book is:
The quality of the book is not mentioned in paper, it is good, the game cases inside are all printed in color, up to the price of this book. But the book width is a lit
For those who do not know about ffmpeg, go to the common basic commands of FFmpeg and read one or two to see if its function can make your app more fun and powerful. It can synthesize audio and video, play audio and video of all types of encoding, intercept a certain segment, and merge multiple images into one video and audio
. Net language APP development platform-Smobiler learning logs: how to upload offline audio files
Smobiler is a development platform that uses the. Net language to develop apps in the VS environment. It may be more convenient than Xamarin.
1. Target Style
The following operations are required to achieve the effect:1. Drag an OfflineVoiceRecorderButton control from "scycler Components" on the toolbar to the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.