Lines Matching refs:wav
60 WAVVoiceOut *wav = (WAVVoiceOut *) hw; in wav_out_run() local
65 int64_t ticks = now - wav->old_ticks; in wav_out_run()
76 wav->old_ticks = now; in wav_out_run()
85 dst = advance (wav->pcm_buf, rpos << hw->info.shift); in wav_out_run()
88 qemu_put_buffer (wav->f, dst, convert_samples << hw->info.shift); in wav_out_run()
92 wav->total_samples += convert_samples; in wav_out_run()
116 WAVVoiceOut *wav = (WAVVoiceOut *) hw; in wav_out_init() local
152 wav->pcm_buf = audio_calloc (AUDIO_FUNC, hw->samples, 1 << hw->info.shift); in wav_out_init()
153 if (!wav->pcm_buf) { in wav_out_init()
164 wav->f = qemu_fopen (conf_out.wav_path, "wb"); in wav_out_init()
165 if (!wav->f) { in wav_out_init()
168 qemu_free (wav->pcm_buf); in wav_out_init()
169 wav->pcm_buf = NULL; in wav_out_init()
173 qemu_put_buffer (wav->f, hdr, sizeof (hdr)); in wav_out_init()
179 WAVVoiceOut *wav = (WAVVoiceOut *) hw; in wav_out_fini() local
182 uint32_t datalen = wav->total_samples << hw->info.shift; in wav_out_fini()
185 if (!wav->f) { in wav_out_fini()
192 qemu_fseek (wav->f, 4, SEEK_SET); in wav_out_fini()
193 qemu_put_buffer (wav->f, rlen, 4); in wav_out_fini()
195 qemu_fseek (wav->f, 32, SEEK_CUR); in wav_out_fini()
196 qemu_put_buffer (wav->f, dlen, 4); in wav_out_fini()
198 qemu_fclose (wav->f); in wav_out_fini()
199 wav->f = NULL; in wav_out_fini()
201 qemu_free (wav->pcm_buf); in wav_out_fini()
202 wav->pcm_buf = NULL; in wav_out_fini()
249 WAVVoiceIn* wav = (WAVVoiceIn *) hw; in wav_in_init() local
255 wav->f = qemu_fopen (path, "rb"); in wav_in_init()
256 if (wav->f == NULL) { in wav_in_init()
262 if (qemu_get_buffer (wav->f, hdr, sizeof(hdr)) != (int)sizeof(hdr)) { in wav_in_init()
281 wav->total_size = le_read( hdr+40, 4 ); in wav_in_init()
317 wav->pcm_buf = audio_calloc (AUDIO_FUNC, hw->samples, 1 << hw->info.shift); in wav_in_init()
318 if (!wav->pcm_buf) { in wav_in_init()
324 qemu_fclose (wav->f); in wav_in_init()
325 wav->f = NULL; in wav_in_init()
332 WAVVoiceIn *wav = (WAVVoiceIn *) hw; in wav_in_fini() local
334 if (!wav->f) { in wav_in_fini()
338 qemu_fclose (wav->f); in wav_in_fini()
339 wav->f = NULL; in wav_in_fini()
341 qemu_free (wav->pcm_buf); in wav_in_fini()
342 wav->pcm_buf = NULL; in wav_in_fini()
347 WAVVoiceIn* wav = (WAVVoiceIn *) hw; in wav_in_run() local
353 int64_t ticks = now - wav->old_ticks; in wav_in_run()
368 wav->old_ticks = now; in wav_in_run()
378 src = advance (wav->pcm_buf, wpos << hw->info.shift); in wav_in_run()
380 qemu_get_buffer (wav->f, src, convert_samples << hw->info.shift); in wav_in_run()
385 wav->total_samples += convert_samples; in wav_in_run()