Record audio played by Android app

Hey everybody
I have android app which can play music…I would need appium to click on play button (easy) and record the audio which phone will play into some file.
So I can then download the audio file and compare it with original source (audio fingerprinting).

Please can anybody advise how to achieve that? … mainly the recording of audio :slight_smile:

Centos 7, Appium 1.6.3, scripting in Ruby


1 Like

Hi Cepin,
Do you find any solution for the recording audio? I am too looking for a similar scenario where I have to check audio after a specified time.

Hey rahuln,
yes but it is little bit hacky solution. We are using audio loopback cable…it is just connection of headphones with microphone on phone using 3,5mm jack and few resistors and capacitors. The quality is not superb but for us useful.
Then we made record function into appium server apk which is installed on the phone.
Then we will just call: @driver.record_audio([time in secs how long it should record])

But anyway this is not useful on newer phones which doesn’t have 3,5mm jack :frowning:

Hey Cepin,

Thanks for the reply.

I have Implemented the workaround, like - 1. Started recording by using system/laptop Mic before expected audio prompt. 2. closed the recording after the specific time duration 3. Stored the file in laptop and just added audio file path and name into test report. (used the JAVA library - javax.sound. ) This also records the other voice on the floor but I am fine with this.

For better voice just plugged the headset and kept the mic near to real device. :slight_smile: