- 浏览: 1510902 次
- 性别:
- 来自: 南京
-
文章分类
- 全部博客 (419)
- XMPP (19)
- Android (180)
- Java (59)
- Network (4)
- HTML5 (13)
- Eclipse (9)
- SCM (23)
- C/C++ (4)
- UML (4)
- Libjingle (15)
- Tools&Softwares (29)
- Linphone (5)
- Linux&UNIX (6)
- Windows (18)
- Google (10)
- MISC (3)
- SIP (6)
- SQLite (5)
- Security (4)
- Opensource (29)
- Online (2)
- 文章 (3)
- MemoryLeak (10)
- Decompile (5)
- Ruby (1)
- Image (1)
- Bat (4)
- TTS&ASR (28)
- Multimedia (1)
- iOS (20)
- Asciiflow - ASCII Flow Diagram Tool.htm (1)
- Networking (1)
- DLNA&UPnP (2)
- Chrome (2)
- CI (1)
- SmartHome (0)
- CloudComputing (1)
- NodeJS (3)
- MachineLearning (2)
最新评论
-
bzhao:
点赞123!
Windows的adb shell中使用vi不乱码方法及AdbPutty -
wahahachuang8:
我觉得这种东西自己开发太麻烦了,就别自己捣鼓了,找个第三方,方 ...
HTML5 WebSocket 技术介绍 -
obehavior:
view.setOnTouchListenerview是什么
[转]android 一直在最前面的浮动窗口效果 -
wutenghua:
[转]android 一直在最前面的浮动窗口效果 -
zee3.lin:
Sorry~~
When I build "call ...
Step by Step about How to Build libjingle 0.4
http://stackoverflow.com/questions/6646313/android-test-if-audio-record-focus-is-available
I am using AudioRecord to record audio for further proccessing. It seems that only one AudioRecord at a time can have access to the audio hardware. How can i check if the audio hardware is accessible, so that i can start recording? One possibility is to instantiate a AudioRecord instance and then check its state with AudioRecord.getState(). This will return, wether the AudioRecord-Instance was initialized properly. Is this the only way to do so? But there is another problem, which you have to address when doing audiorecording. What happens when another application wants to record? Is there any possibility to be notified if another application wants to record?
也就是说如果一个应用在使用音频输入,另一个应用就不能同时使用,否则,会返回错误,log如下:
failed: other input already started
看下代码就明白了:
/hardware/libhardware_legacy/audio/AudioPolicyManagerBase.cpp
status_t AudioPolicyManagerBase::startInput(audio_io_handle_t input) { ... // refuse 2 active AudioRecord clients at the same time if (getActiveInput() != 0) { LOGW("startInput() input %d failed: other input already started", input); return INVALID_OPERATION; } ... }
另外,AudioTrack有时候打印这样的log:
Underrun user: fb0, server: fb0, flags 0003
下面是underrun和overrun的解释:
- underrun
In computing, buffer underrun or buffer underflow is a state occurring when a buffer used to communicate between two devices or processes is fed with data at a lower speed than the data is being read from it. This requires the program or device reading from the buffer to pause its processing while the buffer refills. This can cause undesired and sometimes serious side effects because the data being buffered is generally not suited to stop-start access of this kind.
-
overrun
In computer security and programming, a buffer overflow, or buffer overrun, is an anomaly where a program, while writing data to a buffer, overruns the buffer's boundary and overwrites adjacent memory. This is a special case of violation of memory safety.
Buffer overflows can be triggered by inputs that are designed to execute code, or alter the way the program operates. This may result in erratic program behavior, including memory access errors, incorrect results, a crash, or a breach of system security. Thus, they are the basis of many software vulnerabilities and can be maliciously exploited.
Programming languages commonly associated with buffer overflows include C and C++, which provide no built-in protection against accessing or overwriting data in any part of memory and do not automatically check that data written to an array (the built-in buffer type) is within the boundaries of that array. Bounds checking can prevent buffer overflows.
发表评论
-
[Android] 为Android安装BusyBox —— 完整的bash shell
2013-12-27 10:19 1510http://www.cnblogs.com/xiaowen ... -
Windows的adb shell中使用vi不乱码方法及AdbPutty
2013-12-27 10:17 7617http://www.veryhuo.com/down/ht ... -
AppMobi推出新XDK,可创建测试PhoneGap项目
2012-09-03 13:39 2655AppMobi今天发布了一个新的工具PhoneGap Mobi ... -
Sencha
2012-09-03 12:59 1200http://www.sencha.com/ Se ... -
jQuery Mobile学习
2012-09-01 12:33 1715使用Jquery Mobile设计Android通讯录 ... -
BackBone
2012-09-01 12:34 1272Backbone.js 是一种重量级javascript M ... -
jQTouch
2012-08-30 15:57 994A Zepto/jQuery plugin for mobil ... -
SwiFTP
2012-08-30 15:43 1320SwiFTP is a FTP server that run ... -
kWS
2012-08-30 15:41 1214kWS is a lightweight and fast W ... -
jQuery Mobile
2012-08-30 15:07 1049http://jquerymobile.com/ -
PhoneGap
2012-08-30 15:07 1057http://phonegap.com/ -
Android Button background image pressed/highlighted and disabled states without
2012-08-06 12:49 1693http://shikii.net/blog/android- ... -
[AndriodTips]Image, saved to sdcard, doesn't appear in Android's Gallery app
2012-08-04 16:15 1173http://stackoverflow.com/questi ... -
Voice detection for Android
2012-07-23 11:39 2369Here it is, my fist JAVA applic ... -
[AndroidTip]local reference table overflow (max=512)的错误解决
2012-07-22 22:56 6078JNI层coding经常会遇到ReferenceTable o ... -
[AndroidTip]EditText如何初始状态不获得焦点?
2012-07-22 15:35 1235最简单的办法是在EditText前面放置一个看不到的Linea ... -
[AndroidTip]android textview滚动条
2012-07-21 14:29 1311本来是想做一个显示文字信息的,当文字很多时View的高度不能超 ... -
Google公布Android 4.1完整功能
2012-07-16 09:48 3200http://www.android.com/about/je ... -
Android开发:使用AudioTrack播放PCM音频数据【附源码】
2012-07-13 15:20 20895http://www.linuxidc.com/Linux/2 ... -
Android上的行车记录仪
2012-07-11 22:31 2021MyCar Recorder DailyRoads
相关推荐
在Android平台上,音频录制是应用程序开发中的一个常见需求,`AudioRecord`类是Android SDK提供的一种用于低级音频数据录制的API。这个`Android audioRecord录音Demo`将向我们展示如何利用`AudioRecord`类来实现一个...
在Android平台上,AudioRecord类是用于实现低级别音频录制的核心组件。它允许开发者直接与设备的音频硬件交互,提供了一种高效且灵活的方式来捕获声音数据。本文将深入解析AudioRecord的使用方法及其在语音质量评测...
创建录音会话是通过调用AudioRecord构造函数完成的,需要提供上述参数。例如: ```java int sampleRate = 44100; int channelConfig = AudioFormat.CHANNEL_IN_MONO; int audioFormat = AudioFormat.ENCODING_...
在Android平台上,开发音频应用时,我们经常需要处理声音的录制和播放功能。`AudioRecord`和`AudioTrack`是Android SDK提供的一对关键类,分别用于录音和播放音频数据。这两个类允许开发者进行低级别的音频操作,...
Android支持多个音频输入和输出设备,AudioRecord提供了查询和选择特定设备的功能。 10. **音频权限** 在Android 6.0(API级别23)及以上版本,需要在运行时请求录音权限(Manifest.permission.RECORD_AUDIO)。 ...
综上所述,"AudioRecord.zip"项目是一个实用的工具,它展示了如何利用Android的`AudioRecord`类实现灵活的音频录制和播放功能,同时提供了调整采样率和文件格式的选项,这对于音频应用开发者来说极具价值。...
这个“Android应用源码之AudioRecord-IT计算机-毕业设计.zip”文件包含了一个使用AudioRecord API进行音频录制的示例项目,非常适合那些正在进行Android毕业设计或者想要深入理解Android音频处理的开发者。...
Android提供了两个API用于实现录音功能:android.media.AudioRecord、android.media.MediaRecorder。 网上有很多谈论这两个类的资料。现在大致总结下: 1、AudioRecord 主要是实现边录边播(AudioRecord+...
在Android操作系统中,AudioRecord是音频输入类,它允许开发者从设备的麦克风或其他音频输入源录制音频数据。这个类是Android SDK中的一个关键组件,用于实现各种与声音相关的应用程序,比如语音识别、录音机应用...
`AudioRecord`类是Android SDK提供的一个核心API,用于实现低级别的音频录制功能。本文将深入探讨如何使用`AudioRecord`类来录制音频,并提供相关的编程知识。 首先,我们要理解`AudioRecord`类的基本概念。`Audio...
在Android平台上,AudioRecord是Android SDK提供的一种用于音频录制的核心类。它允许开发者直接与设备的音频硬件交互,实现高质量的音频数据录制功能。本文将深入探讨AudioRecord的相关知识点,包括其基本用法、参数...
在Android平台上,音频录制是移动...总结,Android音频录制涉及到多个层次的技术,包括音频编码、数据处理和文件操作。理解这些概念并熟练运用`AudioRecord`和`MediaRecorder`可以让你在开发音频应用时更加得心应手。
在AudioRecord的工作流程中,应用程序通过调用AudioRecord类的构造函数来创建一个实例,指定音频源、采样率、通道数和数据格式。接着,调用`startRecording()`开始录音,此时,AudioRecord会与HAL层交互,打开音频...
在Android平台上,录音功能是应用程序开发中的一个常见需求,例如制作音乐应用、语音备忘录或者实时通信应用等。`AudioRecord`类是Android SDK提供的一套API,用于实现低级别的音频录制。这个"AudioRecord-master....
使用AudioRecord类实现音频录制需要实例化一个AudioRecord对象,创建一个文件,用于保存录制的内容,打开一个输出流,指向创建的文件,然后调用AudioRecord的startRecording方法开始录制。录制过程中需要创建一个...
《Android平台上的AudioRecord使用详解》 在Android开发中,我们常常需要处理音频录制与播放的任务,这涉及到Android系统中的一个重要类——AudioRecord。本文将深入探讨AudioRecord类的使用,帮助开发者理解如何在...
本项目“AudioRecord lame”提供了一个完整的实例,演示了如何使用Android原生的`AudioRecord`类来录制音频,并结合lame库将录制的音频数据转换为MP3格式。以下是关于这个项目的详细知识点: 1. **Android Audio...
AudioRecord是Android录音功能的核心,其工作流程涵盖了对象创建、音频路由设置、数据读取等多个环节。理解这些细节对于开发高质量的录音应用至关重要。通过AudioRecord,开发者可以灵活地控制录音质量、设备选择...