diff --git a/exp/audio/internal/driver/driver_js.go b/exp/audio/internal/driver/driver_js.go index 8869661a0..b19922ff5 100644 --- a/exp/audio/internal/driver/driver_js.go +++ b/exp/audio/internal/driver/driver_js.go @@ -39,7 +39,7 @@ func NewPlayer(src io.Reader, sampleRate, channelNum, bytesPerSample int) (*Play class = js.Global.Get("webkitAudioContext") } if class == js.Undefined { - return nil, errors.New("audio: audio couldn't be initialized") + return nil, errors.New("driver: audio couldn't be initialized") } p := &Player{ src: src, diff --git a/exp/audio/internal/driver/driver_windows.go b/exp/audio/internal/driver/driver_windows.go index d88ef5701..2d49fcc23 100644 --- a/exp/audio/internal/driver/driver_windows.go +++ b/exp/audio/internal/driver/driver_windows.go @@ -50,18 +50,18 @@ func newHeader(waveOut C.HWAVEOUT, bufferSize int) (*header, error) { } // TODO: Need to unprepare to avoid memory leak? if err := C.waveOutPrepareHeader(waveOut, &h.waveHdr, C.sizeOfWavehdr); err != C.MMSYSERR_NOERROR { - return nil, fmt.Errorf("audio: waveOutPrepareHeader error: %d", err) + return nil, fmt.Errorf("driver: waveOutPrepareHeader error: %d", err) } return h, nil } func (h *header) Write(waveOut C.HWAVEOUT, data []byte) error { if len(data) != h.bufferSize { - return errors.New("audio: len(data) must equal to h.bufferSize") + return errors.New("driver: len(data) must equal to h.bufferSize") } C.memcpy(h.buffer, unsafe.Pointer(&data[0]), C.size_t(h.bufferSize)) if err := C.waveOutWrite(waveOut, &h.waveHdr, C.sizeOfWavehdr); err != C.MMSYSERR_NOERROR { - return fmt.Errorf("audio: waveOutWriter error: %d", err) + return fmt.Errorf("driver: waveOutWriter error: %d", err) } return nil } @@ -96,7 +96,7 @@ func NewPlayer(src io.Reader, sampleRate, channelNum, bytesPerSample int) (*Play } var w C.HWAVEOUT if err := C.waveOutOpen2(&w, &f); err != C.MMSYSERR_NOERROR { - return nil, fmt.Errorf("audio: waveOutOpen error: %d", err) + return nil, fmt.Errorf("driver: waveOutOpen error: %d", err) } p := &Player{ src: src, @@ -136,7 +136,7 @@ func (p *Player) Proceed() error { } } if headerToWrite == nil { - return errors.New("audio: no available buffers") + return errors.New("driver: no available buffers") } if err := headerToWrite.Write(p.out, p.buffer[:bufferSize]); err != nil { return err