mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
audio: Add comments about errors (#331)
This commit is contained in:
parent
e06334c95f
commit
1497d52928
@ -230,7 +230,7 @@ func NewContext(sampleRate int) (*Context, error) {
|
||||
// you will find audio stops when the game stops e.g. when the window is deactivated.
|
||||
// In async mode, the audio never stops even when the game stops.
|
||||
//
|
||||
// Update returns error when IO error occurs.
|
||||
// Update returns error when IO error occurs in the underlying IO object.
|
||||
func (c *Context) Update() error {
|
||||
// Initialize c.driver lazily to enable calling NewContext in an 'init' function.
|
||||
// Accessing driver functions requires the environment to be already initialized,
|
||||
@ -323,6 +323,9 @@ type Player struct {
|
||||
//
|
||||
// Note that the given src can't be shared with other Players.
|
||||
//
|
||||
// NewPlayer tries to rewind src by calling Seek to get the current position.
|
||||
// NewPlayer returns error when the Seek returns error.
|
||||
//
|
||||
// This function is concurrent-safe.
|
||||
func NewPlayer(context *Context, src ReadSeekCloser) (*Player, error) {
|
||||
if context.players.hasSource(src) {
|
||||
@ -352,6 +355,8 @@ func NewPlayer(context *Context, src ReadSeekCloser) (*Player, error) {
|
||||
//
|
||||
// The format of src should be same as noted at NewPlayer.
|
||||
//
|
||||
// NewPlayerFromBytes returns error in the same situation of NewPlayer.
|
||||
//
|
||||
// This function is concurrent-safe.
|
||||
func NewPlayerFromBytes(context *Context, src []byte) (*Player, error) {
|
||||
b := BytesReadSeekCloser(src)
|
||||
|
Loading…
Reference in New Issue
Block a user