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

mp3 memory usage and time to play #25

Open
WesleiRamos opened this issue Aug 20, 2017 · 1 comment
Open

mp3 memory usage and time to play #25

WesleiRamos opened this issue Aug 20, 2017 · 1 comment

Comments

@WesleiRamos
Copy link

WesleiRamos commented Aug 20, 2017

I think the memory usage is stable and it's taking a long time to play, about 15 seconds.
WAV plays instantly.

I'm using Windows 10, mp3 file size 3,4MB

(Sorry my english)

code

package main

import "time"
import audio "github.com/200sc/klangsynthese"

func main() {
	player, _ := audio.LoadFile("fazenda.mp3")
	println("Tocando")
	if err := <-player.Play(); err != nil {
		panic(err)
	}
	time.Sleep(player.PlayLength())
}
@200sc
Copy link
Owner

200sc commented Aug 20, 2017

If it's a large file, it will load the entire thing and then play it, which would take more time-- We currently don't stream the audio, which would reduce loading time and memory usage. There'd have to be some thought about how the API would change to accommodate streaming, but I'm open to suggestions.

Beyond streaming there's always a chance we could speed things up in another way, like by offering non-Direct Sound windows audio.

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