audiotrack

Record audio played on AudioTrack?

大兔子大兔子 提交于 2019-12-13 04:44:08
问题 I have an android app that plays a generated tone on an AudioTrack, so my question is: is there a way to record whatever is played on that AudioTrack(it's started, stopped, written to, and released frequently), be able to play it back, and save it to the music library? The class that plays the music: package com.example.test; import android.app.Activity; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android

Issue encoding and decoding an audio recording to G711 ( PCMU - uLaw) format

吃可爱长大的小学妹 提交于 2019-12-12 08:36:00
问题 There isn't too much info about apply this codec when we need to streaming audio. Without apply the codec, my code work like a charm establishing a communication between 2 devices but I need encode/decode in that format because I will need streaming with the server and not between two devices (I am testing this code using 2 devices). I am looking for the chance if anyone of your could see where is the key of my problem. I've tried different configurations of the input parameters. Maybe, the

Start new stream with AACDecoder

给你一囗甜甜゛ 提交于 2019-12-11 10:08:21
问题 I'm doing a radio Application (Tune In like) The situations : When the radio start at first it play an audio AD and then start the radio (AD and radio are 2 diferents streams) When a AACPlayer is currently playing music and the user change station Two problems : When the ad finish the AACPlayer need to stop and start with another URL When the user select another radio it is the same With the AACDecoder library there are only two methods - start() - stop() Those methods can interfere with each

AudioTrack is not playing audio file properly as it is making noise instead

我们两清 提交于 2019-12-11 09:45:13
问题 I have recorded user's voice successfully using mediaplayer and the file is stored in sd card. now i want to play that voice using audio track. But when I do it is making noise. Y so.? Here is the code to play sound.. private void PlayAudioFileViaAudioTrack(String filePath) throws IOException { // We keep temporarily filePath globally as we have only two sample sounds now.. if (filePath==null) return; int intSize = android.media.AudioTrack.getMinBufferSize(44100, AudioFormat.CHANNEL

Android Action Down with radio button

久未见 提交于 2019-12-11 04:57:20
问题 I'm currently trying to make my project so that when one of the radio buttons are selected and a button is held then it produces the selected sound. however when I used the ACTION_DOWN function, no noise is produced. Any help would be great public boolean onTouch(View v, MotionEvent event) { int frequency = Integer.parseInt(frequencyInput.getText().toString()); displayFrequency.setText(String.valueOf(frequency)); sineWave.setSine(frequency); squareWave.setSquareWave(frequency); sawWave

Android Application crashes after generating an audio signal a few times

做~自己de王妃 提交于 2019-12-11 04:19:59
问题 I'm developping an application to send a text through chirp signals. Basically I give the user the chance to write a text, and select a start frequency, a final frequency and some other options about time separtion between and duration of the bits to be sent. In the app I split the text into chars, convert them into ASCII integers, convert those integers into binaries and then send them with chirp signals (in Big Endian), with a 5ms chirp that goes from initial freq to final freq (down to up)

How to play InputStream of an audio file that's not within a url or storage?

纵饮孤独 提交于 2019-12-08 17:01:03
问题 Background I've succeeded uploading an audio file (3gp) into Google-Drive. Now I want to be able to play the file within the app. The Google Drive API only allows to get the input stream of the file that's stored there. The problem All MediaPlayer capabilities of inputs aren't available in my case, which is only InputSteam: http://developer.android.com/reference/android/media/MediaPlayer.html#setDataSource(java.io.FileDescriptor) I know I can save the file from the Google-Drive to the cache

need to understad how AudioRecord and AudioTrack work for raw PCM capture and playback

被刻印的时光 ゝ 提交于 2019-12-08 11:56:41
问题 I use the following code in a Thread to capture raw audio samples from the microphone and play it back through the speaker. public void run(){ short[] lin = new short[SIZE_OF_RECORD_ARRAY]; int num = 0; // am = (AudioManager) this.getSystemService(Context.AUDIO_SERVICE); // -> MOVED THESE TO init() // am.setMode(AudioManager.MODE_IN_COMMUNICATION); record.startRecording(); track.play(); while (passThroughMode) { // while (!isInterrupted()) { num = record.read(lin, 0, SIZE_OF_RECORD_ARRAY);

How to remove background Noise in Audio Track?

若如初见. 提交于 2019-12-08 11:56:07
问题 I am developing VOIP kind of application. Sending the voice is perfect but when i receive the same voice from the webserver, i am playing back that using AudioTrack API. I am calling at.play() and at.write in a Thread so that i should get all the voice which is recorded and sent from the other device. But, now the problem here i m facing is, if there is no voice than its still playing like some bullet sound, i mean there is a continuos background sound when i try to play . I m using this

Android AudioTrack slow playback

别来无恙 提交于 2019-12-08 05:54:05
问题 I'm trying to stream music in using AudioTrack. The track plays, but the audio plays at half the rate. It's like the song has become slow motion. try{ AudioTrack track= new AudioTrack( AudioManager.STREAM_MUSIC, 44100, android.media.AudioFormat.CHANNEL_CONFIGURATION_MONO, android.media.AudioFormat.ENCODING_PCM_16BIT, android.media.AudioTrack.getMinBufferSize( 44100, android.media.AudioFormat.CHANNEL_CONFIGURATION_STEREO, android.media.AudioFormat.ENCODING_PCM_16BIT ), AudioTrack.MODE_STREAM )