mirror of
https://github.com/bloeys/wavy.git
synced 2025-12-29 09:28:19 +00:00
Improve CopyInMemSound panic msg
This commit is contained in:
4
wavy.go
4
wavy.go
@ -160,8 +160,8 @@ func (s *Sound) Close() error {
|
||||
//Since the sound data is not copied this function is very fast.
|
||||
func CopyInMemSound(s *Sound) *Sound {
|
||||
|
||||
if s.Info.Mode == SoundMode_Streaming {
|
||||
panic("streaming sounds can not be copied. Please use NewSoundStreaming instead")
|
||||
if s.Info.Mode != SoundMode_Memory {
|
||||
panic("only in-memory sounds can not be copied. Please use NewSoundStreaming if you want to have multiple sound objects of a streaming sound")
|
||||
}
|
||||
|
||||
d := s.Data.(*SoundBuffer).Copy()
|
||||
|
||||
Reference in New Issue
Block a user