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

SDL_Mixer: Flac support not available #457

Open
Keithcat1 opened this issue May 2, 2020 · 5 comments
Open

SDL_Mixer: Flac support not available #457

Keithcat1 opened this issue May 2, 2020 · 5 comments

Comments

@Keithcat1
Copy link
Contributor

FLAC support is not available.
I have mix.INIT_FLAC specified.
go version go1.14.1 windows/amd64

@veeableful
Copy link
Contributor

Hi @Keithcat1, could you post the a minimal code that reproduces the issue? I tried to reproduce it but was unable to.

@Keithcat1
Copy link
Contributor Author

package main
import(
"github.com/veandco/go-sdl2/mix"
"time"
"os"
)
func HandleError(err error) {
if err!=nil { panic(err) }
}
func main() {
if len(os.Args)<2 {
println("Usage: File\n")
os.Exit(0)
}
file:=os.Args[1]
HandleError(mix.Init(mix.INIT_MP3|mix.INIT_OGG|mix.INIT_FLAC))
HandleError(mix.OpenAudio(mix.DEFAULT_FREQUENCY, mix.DEFAULT_FORMAT, mix.DEFAULT_CHANNELS, mix.DEFAULT_CHUNKSIZE))
defer mix.CloseAudio()
ch, err:=mix.LoadMUS(file)
HandleError(err)
err=ch.Play(3)
HandleError(err)
for mix.PlayingMusic() {
time.Sleep(time.Millisecond*5)
}
}

@veeableful
Copy link
Contributor

Hi @Keithcat1, could you tell me what kind of error did you encounter? Depending on the problem, it might be possible to solve the issue by copying the SDL2 *.dll files. For example:

cp /c/Program\ Files/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/x86_64-w64-mingw32/bin/lib*.dll .

Your MinGW version might be a little different!

@Keithcat1
Copy link
Contributor Author

panic: FLAC support not available

goroutine 1 [running, locked to thread]:
main.HandleError(...)
command-line-arguments/s.go:8
main.main()
command-line-arguments/s.go:16 +0x1fa

@veeableful
Copy link
Contributor

Hi @Keithcat1, did you try coping the *.dll files into your program directory? If you have, could you list the files in your program directory (with ls -lh for example)? There should be a .dll file for FLAC.

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

2 participants