this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

get to vorbis string

+18 -2
+18 -2
src/formats/flac.odin
··· 2 2 3 3 import "core:bufio" 4 4 import "core:fmt" 5 + import "core:io" 5 6 import os "core:os/os2" 6 7 import "core:testing" 7 8 ··· 69 70 read :: proc(file: ^os.File) -> (c: VorbisComment, err: ReadError) { 70 71 71 72 r: bufio.Reader 72 - buffer: [1024]byte 73 - bufio.reader_init_with_buf(&r, os.to_reader(file), buffer[:]) 73 + buffer: [1024 * 8]byte 74 + stream := os.to_reader(file) 75 + bufio.reader_init_with_buf(&r, stream, buffer[:]) 74 76 defer bufio.reader_destroy(&r) 75 77 76 78 // Check marker ··· 103 105 104 106 if (header.stream_info == VORBIS_COMMENT) { 105 107 fmt.printfln("Found Vorbis Comment") 108 + 109 + vorbisCommentBytes := make([]byte, header.length) 110 + defer delete(vorbisCommentBytes) 111 + 112 + s := bufio.reader_to_stream(&r) 113 + 114 + vn, verr := io.read_full(s, vorbisCommentBytes) 115 + if verr != nil || cast(u32)vn != header.length { 116 + fmt.printfln("Failed to read voribs comment as bytes %v %d", verr, vn) 117 + return VorbisComment{}, .UnknownError 118 + } 119 + 120 + fmt.printfln("\n\n Vorbis Comment Bytes: %s \n\n", vorbisCommentBytes) 121 + 106 122 return VorbisComment{title = "Vampire in the Corner"}, nil 107 123 } 108 124