Skip to content
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

How to decode file encoded by opusenc #59

Open
linnv opened this issue Apr 19, 2024 · 0 comments
Open

How to decode file encoded by opusenc #59

linnv opened this issue Apr 19, 2024 · 0 comments

Comments

@linnv
Copy link

linnv commented Apr 19, 2024

There is a file which is encoded by opusenc --raw-rate 16000 nowavheader-stereo.pcm nowavheader-stereo.opus

i can decode it using opusdec --rate 16000 nowavheader-stereo.opus nowavheader-stereo.opus.pcm,

I've tried these code

	opusbs, err := os.ReadFile("./nowavheader-stereo.opus")
	if err != nil {
		panic(err.Error())
	}
	decoder := opus.NewDecoder()
	out := make([]byte, 1920)
	bandwidth, isStereo, err := decoder.Decode(opusbs, out)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("bandwidth: %+v, isStereo: %+v\n", bandwidth, isStereo)
	_ = decoder

but I got this error
panic: unsupported frame code: 3

file is bellow:
MD5 (nowavheader-stereo.pcm) = 9b5ba9b8bc5b96c8055d93033553184c MD5 (nowavheader-stereo.opus) = 13e606dfa6545c9b51a85a30cef2ab6f

opusenc --version
opusenc opus-tools 0.2 (using libopus 1.5.2) Copyright (C) 2008-2018 Xiph.Org Foundation

how to decode it using this package,any example please?
Archive.zip

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

No branches or pull requests

1 participant