MCPcopy
hub / github.com/EngoEngine/engo / LoadedPlayer

Function LoadedPlayer

common/audio_filetype.go:86–98  ·  view source on GitHub ↗

LoadedPlayer retrieves the *audio.Player created from the URL

(url string)

Source from the content-addressed store, hash-verified

84
85// LoadedPlayer retrieves the *audio.Player created from the URL
86func LoadedPlayer(url string) (*Player, error) {
87 res, err := engo.Files.Resource(url)
88 if err != nil {
89 return nil, err
90 }
91
92 audioRes, ok := res.(*Player)
93 if !ok {
94 return nil, fmt.Errorf("resource not of type `*Player`: %s", url)
95 }
96
97 return audioRes, nil
98}
99
100// readSeekCloserBuffer is a wrapper to create a ReadSeekCloser
101type readSeekCloserBuffer struct {

Callers 11

SetupMethod · 0.92
SetupMethod · 0.85
TestAudioLoaderLoadOggFunction · 0.85
TestAudioLoaderLoadWavFunction · 0.85
TestAudioLoaderLoadMP3Function · 0.85
TestAudioLoaderUnloadFunction · 0.85
TestAudioPlayerURLFunction · 0.85
TestAudioPlayerCloseFunction · 0.85
TestAudioPlayerPlayFunction · 0.85
TestAudioPlayerSeekFunction · 0.85
TestAudioPlayerVolumeFunction · 0.85

Calls 1

ResourceMethod · 0.65

Tested by 10

SetupMethod · 0.68
TestAudioLoaderLoadOggFunction · 0.68
TestAudioLoaderLoadWavFunction · 0.68
TestAudioLoaderLoadMP3Function · 0.68
TestAudioLoaderUnloadFunction · 0.68
TestAudioPlayerURLFunction · 0.68
TestAudioPlayerCloseFunction · 0.68
TestAudioPlayerPlayFunction · 0.68
TestAudioPlayerSeekFunction · 0.68
TestAudioPlayerVolumeFunction · 0.68