mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
examples: fix ./v -W -Wfatal-errors build-examples
, run vfmt
This commit is contained in:
@ -53,11 +53,11 @@ fn audio_player_callback(buffer &f32, num_frames int, num_channels int, mut p Pl
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn (mut p Player) init() {
|
fn (mut p Player) init() {
|
||||||
audio.setup({
|
audio.setup(
|
||||||
num_channels: 2
|
num_channels: 2
|
||||||
stream_userdata_cb: audio_player_callback
|
stream_userdata_cb: audio_player_callback
|
||||||
user_data: p
|
user_data: p
|
||||||
})
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn (mut p Player) stop() {
|
fn (mut p Player) stop() {
|
||||||
@ -155,7 +155,7 @@ fn read_wav_file_samples(fpath string) ?[]f32 {
|
|||||||
//
|
//
|
||||||
if ch.chunk_type == [byte(`f`), `m`, `t`, ` `]! {
|
if ch.chunk_type == [byte(`f`), `m`, `t`, ` `]! {
|
||||||
// eprintln('`fmt ` chunk')
|
// eprintln('`fmt ` chunk')
|
||||||
rf = &RIFFFormat(&ch.chunk_data)
|
rf = unsafe { &RIFFFormat(&ch.chunk_data) }
|
||||||
// eprintln('fmt riff format: $rf')
|
// eprintln('fmt riff format: $rf')
|
||||||
if rf.format_tag != 1 {
|
if rf.format_tag != 1 {
|
||||||
return error('only PCM encoded WAVs are supported')
|
return error('only PCM encoded WAVs are supported')
|
||||||
|
Reference in New Issue
Block a user