mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-12 20:18:59 +01:00
audio: Bug fix: compilation error on Windows
This commit is contained in:
parent
2840bafd0a
commit
bbdb522b15
@ -85,14 +85,14 @@ type Player struct {
|
|||||||
const bufferSize = 1024
|
const bufferSize = 1024
|
||||||
|
|
||||||
func NewPlayer(src io.Reader, sampleRate, channelNum, bytesPerSample int) (*Player, error) {
|
func NewPlayer(src io.Reader, sampleRate, channelNum, bytesPerSample int) (*Player, error) {
|
||||||
const numBlockAlign = channelNum * bytesPerSample
|
numBlockAlign := channelNum * bytesPerSample
|
||||||
f := C.WAVEFORMATEX{
|
f := C.WAVEFORMATEX{
|
||||||
wFormatTag: C.WAVE_FORMAT_PCM,
|
wFormatTag: C.WAVE_FORMAT_PCM,
|
||||||
nChannels: channelNum,
|
nChannels: C.WORD(channelNum),
|
||||||
nSamplesPerSec: C.DWORD(sampleRate),
|
nSamplesPerSec: C.DWORD(sampleRate),
|
||||||
nAvgBytesPerSec: C.DWORD(sampleRate) * numBlockAlign,
|
nAvgBytesPerSec: C.DWORD(sampleRate * numBlockAlign),
|
||||||
wBitsPerSample: bytesPerSample * 8,
|
wBitsPerSample: C.WORD(bytesPerSample * 8),
|
||||||
nBlockAlign: numBlockAlign,
|
nBlockAlign: C.WORD(numBlockAlign),
|
||||||
}
|
}
|
||||||
var w C.HWAVEOUT
|
var w C.HWAVEOUT
|
||||||
if err := C.waveOutOpen2(&w, &f); err != C.MMSYSERR_NOERROR {
|
if err := C.waveOutOpen2(&w, &f); err != C.MMSYSERR_NOERROR {
|
||||||
|
Loading…
Reference in New Issue
Block a user