Compare commits
No commits in common. "430677fc07655e190bcea7951bd11075b2911445" and "612421f7b6ff34223a41a19abef4d6a1fb2b6cd8" have entirely different histories.
430677fc07
...
612421f7b6
4 changed files with 2 additions and 9 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,3 +1 @@
|
||||||
zig-cache/
|
zig-cache/
|
||||||
*.mp3
|
|
||||||
*.wav
|
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
load :0;
|
|
||||||
embed 3 1 ./file.wav;
|
|
||||||
quicksave;
|
|
|
@ -164,8 +164,6 @@ pub const Embed = struct {
|
||||||
&in_fmt,
|
&in_fmt,
|
||||||
);
|
);
|
||||||
|
|
||||||
image.sseek(self.sndfile, 0);
|
|
||||||
|
|
||||||
self.buf = try self.allocator.alloc(f32, @intCast(usize, in_fmt.channels));
|
self.buf = try self.allocator.alloc(f32, @intCast(usize, in_fmt.channels));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,7 +173,7 @@ pub const Embed = struct {
|
||||||
const read_bytes = c.sf_readf_float(self.sndfile, self.buf.ptr, 1);
|
const read_bytes = c.sf_readf_float(self.sndfile, self.buf.ptr, 1);
|
||||||
|
|
||||||
if (read_bytes == 0) {
|
if (read_bytes == 0) {
|
||||||
bufs.out[0] = bufs.in[0];
|
std.debug.warn("WARN! reached EOF for embed\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ pub fn swrite(file: *c.SNDFILE, buf: [*]f32, frames: i64) !void {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn sseek(file: *c.SNDFILE, offset: usize) void {
|
fn sseek(file: *c.SNDFILE, offset: usize) void {
|
||||||
const offset_i64 = @intCast(i64, offset);
|
const offset_i64 = @intCast(i64, offset);
|
||||||
const frames = c.sf_seek(file, offset_i64, c.SEEK_SET);
|
const frames = c.sf_seek(file, offset_i64, c.SEEK_SET);
|
||||||
const frames_current = c.sf_seek(file, 0, c.SEEK_CUR);
|
const frames_current = c.sf_seek(file, 0, c.SEEK_CUR);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue