Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

Play audio from buffer #13

Open
xoapit opened this issue Jan 15, 2019 · 9 comments
Open

Play audio from buffer #13

xoapit opened this issue Jan 15, 2019 · 9 comments

Comments

@xoapit
Copy link

xoapit commented Jan 15, 2019

Hi all,

I am trying to join buffer and playback it. Does anyone have a idea for this case.

Thanks in advance.

@brycepavey
Copy link

@xoapit did you find a solution for this?

@xoapit
Copy link
Author

xoapit commented Mar 19, 2019

Actually, I cannot do it. I have some ideas to record VOIP in android device. But most of them are not supported to record VOIP so I tried to do this in the server.

@GiampaoloComida
Copy link

Hi, did you find a solution for this?

@eduardotamaki
Copy link

Someone could find a solution for this? @xoapit @GiampaoloComida @brycepavey

@brycepavey
Copy link

brycepavey commented Jan 15, 2020

@eduardotamaki my colleague created a fork where we use a circular buffer.
This was for a client project so it's not maintained beyond our requirements for that, but it might still be able to help you. Check it out here though https://github.com/dreamwalk-os/react-native-audio-record

@is343
Copy link
Contributor

is343 commented Jan 15, 2020

@brycepavey that's awesome!
We'd love and welcome a PR to roll that functionality into the main library if you're able.

@eduardotamaki
Copy link

@brycepavey Awesome, I will have a look to it...

@sonnd08
Copy link

sonnd08 commented Nov 20, 2020

I already resolve this, basically, data return from on('data', (data) =>{} is base 64 encoded for pcm format. It's almost the same as wav but missing the wav header

I do it in a tricky way, I don't care much about the header and the config is not usually change so I get the normal output wav (from result file path) and extract the header bytes (first 44 bytes). Every time I want to stream audio file, I stream these header bytes first, others bytes from base64 chunks will be sent later. (buffer is bytes array)

If your guys have better ways to build wav header, please let me know

@maxckelly
Copy link

A good package we're using at the moment is ffmpeg this allows you to create and convert audio files from mp3, wav etc... might help as we're using it to stream and build files in the server.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants