10 // ////////////////////////////////////////////////////////////////////////// //
11 void main (string
[] args
) {
12 assert(args
.length
> 1);
14 OpusFile of
= opusOpen(VFile(args
[1]));
15 scope(exit
) opusClose(of
);
17 conwriteln("vendor: [", of
.vendor
, "]");
18 conwriteln("channels: ", of
.channels
);
19 conwritefln
!"duration: %s:%02s"(of
.duration
/1000/60, of
.duration
/1000%60);
20 conwriteln("comment count: ", of
.commentCount
);
21 foreach (immutable cidx
; 0..of
.commentCount
) conwriteln(" #", cidx
, ": [", of
.comment(cidx
), "]");
23 version(noplay
) {} else alsaOpen(of
.channels
);
24 version(noplay
) {} else scope(exit
) alsaClose();
30 auto rd
= of
.readFrame();
31 if (rd
.length
== 0) break;
33 version(noplay
) {} else {
34 if (lasttime
!= of
.curtime
) {
35 lasttime
= of
.curtime
;
36 conwritef
!"\r%s:%02s / %s:%02s"(lasttime
/1000/60, lasttime
/1000%60, of
.duration
/1000/60, of
.duration
/1000%60);
38 alsaWriteX(rd
.ptr
, cast(uint)rd
.length
/of
.channels
);