Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Can't import OPUS audio into Audacity and Windows shows media length is 0s #47

@stodge

Description

@stodge

I copied the code to encode to an OPUS audio file from the following link. The audio file will play back in Windows, and I think it sounds correct. However, Audacity won't import it (incorrect filetype, even though the file extension is ".opus") and the properties for the audio (via the file explorer) show the media length is 0s.

https://github.com/lostromb/concentus/blob/master/Java/ConcentusTestConsole/src/main/java/org/concentus/console/Program.java#L24

It occurred to me that the loop doesn't process all bytes from the input stream.

while (fileIn.available() >= inBuf.length) {

It misses a number of bytes. After the loop is done, there are still bytes left in the stream:

fileIn.available()

Results in - Available: 1836

I tried encoding the remaining bytes after the loop, but I got an error:

Exception in thread "main" java.lang.IllegalArgumentException: Not enough samples provided in input signal: Expected 960 samples, found 918

Any suggestions appreciated.
Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions