-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Audio frame.samples buffer type as FloatBuffer nok for replay. #18
Comments
It's probably a better idea to convert the BTW. we can modify |
For me works this code:
I found it here: https://www.kvraudio.com/forum/viewtopic.php?f=33&t=414666 Full JavaFx player example:
|
@d-a-gerashenko Awesome, could you send a pull request to add it to the samples? |
…r` convert audio samples to user-specified format (issue #18)
The fix for this has been released as part of JavaCV 1.3.3. Enjoy! |
FFmpegFrameGrabber returns frame.samples as ShortBuffer if the file type is *.mp3.
This is Ok. It is clear played back.
Both video and audio (recorded from *.mp3 or from microphone) are written into *.mp4 where audio.samples as ShortBuffer. Replay via mediaplayer Ok.
However, despite written as ShortBuffer, if the fileType read is *.mp4, frame.samples come in FloatFormat. And handling of the FloatFormat is the problem. The extracted byteArray plays with a lot of noise.
Only by using the first byte of the extracted byteArray, the noise was a lot reduced, but it is still there.
Please see the code extract below. Also the strange filter is given as a dirty workaround.
Am I missing a better way of converting this strange FloatFormat to ByteArray?
I suspect this is a bug. Also often by recording the sampleRate needs to be doubled and by playing halved, indicate there is a problem with audio sampleRate too.
Any tipp is very much appreciated.
The text was updated successfully, but these errors were encountered: