audio-recording

Best practice for C++ audio capture API under Linux?

て烟熏妆下的殇ゞ 提交于 2019-12-23 07:53:10
问题 I need to create a C++ application with a simple audio recording from microphone functionality. I can't say that there aren't enough audio APIs to do this! Pulse, ALSA, /dev/dsp, OpenAL, etc. My question is what is the current "Best practice" API? Pulse seems supported by most modern distros, but seems almost devoid of documentation. Will OpenAL be supported across different distros, or is it too obscure? Have I missed any? Is there not a simple answer? 回答1: Lennart Pottering has a guide here

Why does AudioRecord.getMinBufferSize return ERROR_BAD_VALUE (-2)?

吃可爱长大的小学妹 提交于 2019-12-23 07:16:02
问题 I am testing this on a Samsung Galaxy S i9000. int sampleRate = 44100; int bufferSize = AudioRecord.getMinBufferSize(sampleRate, AudioFormat.CHANNEL_IN_MONO, AudioFormat.ENCODING_PCM_8BIT); It returns -2 ERROR_BAD_VALUE . The native sample rate is 44100Hz, as returned by AudioTrack.getNativeOutputSampleRate(AudioManager.STREAM_SYSTEM). I have tried setting sampleRate to 1000, 8000, 22100 and 44100. I have also tried changing AudioFormat.CHANNEL_IN_MONO to AudioFormat.CHANNEL_CONFIGURATION

MPAVController >> Not enough buffered to keep up

徘徊边缘 提交于 2019-12-23 05:17:21
问题 I am playing video using this code. player= [[ MPMoviePlayerViewController alloc] initWithContentURL:movieURL]; player.navigationController.navigationBar.hidden = YES; player.moviePlayer.scalingMode = MPMovieScalingModeAspectFit; player.moviePlayer.controlStyle = MPMovieControlStyleNone; player.moviePlayer.movieSourceType = MPMovieSourceTypeFile; player.moviePlayer.fullscreen = NO; [self presentModalViewController:player animated:NO]; Video playing works perfectly But the problem is that

Android: No such file or directory found error?

浪尽此生 提交于 2019-12-23 03:28:09
问题 I'm playing and recording an audio simultaneously in order to perform audio matching analysis using musicg API. I'm getting the following error/s everytime I run my app: V/playRecordAudio: Playing sound & recording stopped W/System.err: java.io.FileNotFoundException: /storage/emulated/0: open failed: EISDIR (Is a directory) W/System.err: at libcore.io.IoBridge.open(IoBridge.java:452) W/System.err: at java.io.FileOutputStream.<init>(FileOutputStream.java:87) W/System.err: at java.io

getting error code 20 with AudioRecord instance

家住魔仙堡 提交于 2019-12-23 02:59:32
问题 I am developing an android application that records through MIC and changes its frequency. Similar to Helium booth app for iphone. For the time being i have written code to record a file and save it in sdcard. I am getting an error which says: Could not get audio input for record source 1 Error creating AudioRecord instance: initialization check failed. [ android.media.AudioRecord ] Error code -20 when initializing native FATAL EXCEPTION: Thread-10 java.lang.IllegalStateException:

How to know the length of an audio recording in Android

馋奶兔 提交于 2019-12-23 02:22:06
问题 I am using the following code to record audio: Intent intent = new Intent(Intent.ACTION_GET_CONTENT); intent.setType("audio/*"); startActivityForResult(Intent.createChooser(intent, "Select audio source"), CardList.ACTIVITY_RECDAUDIO); When the result comes back I do the following: Uri u = intent.getData(); String audioUri = u.getPath(); InputStream in = new BufferedInputStream(this.getContentResolver().openInputStream(u)); I would like to know how long the recording is in seconds. Is it

Is there a way to record an audio stream using Matt Gallagher's audio streamer?

半城伤御伤魂 提交于 2019-12-23 02:17:15
问题 I use Matt Gallagher's audio streamer for streaming radio stations. But how to record the audio? Is there a way to get the downloaded packets into NSData and save it in an audio file in the documents folder on the iPhone? Thanks 回答1: Yes, there is and I have done it. My problem is being able to play it back IN the same streamer (asked elsewhere). It will play back with the standard AVAudioPlayer in iOS. However, this will save the data to a file by writing it out in the streamer code. This

Is it possible to record audio in iOS with Codename One?

浪尽此生 提交于 2019-12-22 18:30:54
问题 My app features a button to record audio (and another to play it back when the recording is over). I send the recorded audio files on a server. On Android the files is recorded as .amr (mime type audio/amr) and can be played back. On iOS however the file can neither be played back on the device (iPhone 4 or 4S) nor on a computer. ffmpeg -i reports [mov,mp4,m4a,3gp,3g2,mj2 @ 0x2fac120] moov atom not found 9gMjOnnmsj9JJZR3.m4a: Invalid data found when processing input Please note that VLC

IOS record audio and split it into files in real time

百般思念 提交于 2019-12-22 12:37:29
问题 I am making an app which needs to stream audio to a server. What I want to do is to divide the recorded audio into chunks and upload them while recording. I used two recorders to do that, but it didn't work well; I can hear the difference between the chunks (stops for couple of milliseconds). How can I do this? 回答1: Your problem can be broken into two pieces: recording and chunking (and uploading, but who cares). For recording from the microphone and writing to the file, you can get started

Circular Buffer Audio Recording iOS: Possible?

随声附和 提交于 2019-12-22 11:09:36
问题 A client of mine wants to continually record audio and when he clicks submit he wants to submit the last 10 seconds only. So he wants a continual recording and only keeping the last x seconds. I would think this requires something like a circular buffer, but (as a somewhat newbie for iOS) it looks like AVAudioRecorder can only write to a file. Are there any options for me to implement this? Can anyone give a pointer? 回答1: I would use the Audio Queue Services. This will allow you isolate