+long
+op_bitrate_instant(of)
+ Audio::Opusfile of;
+POSTCALL:
+ if(RETVAL < 0)
+ croak("op_bitrate_instant returned error %ld\n", RETVAL);
+
+long
+op_raw_tell(of)
+ Audio::Opusfile of;
+POSTCALL:
+ if(RETVAL < 0)
+ croak("op_raw_tell returned error %ld\n", RETVAL);
+
+long
+op_pcm_tell(of)
+ Audio::Opusfile of;
+POSTCALL:
+ if(RETVAL < 0)
+ croak("op_pcm_tell returned error %ld\n", RETVAL);
+
+NO_OUTPUT int
+op_raw_seek(of, offset)
+ Audio::Opusfile of;
+ long offset;
+POSTCALL:
+ if(RETVAL)
+ croak("op_raw_seek returned error %d\n", RETVAL);
+
+NO_OUTPUT int
+op_pcm_seek(of, offset)
+ Audio::Opusfile of;
+ long offset;
+POSTCALL:
+ if(RETVAL)
+ croak("op_pcm_seek returned error %d\n", RETVAL);
+
+NO_OUTPUT int
+op_set_gain_offset(of, gain_type, gain_offset_q8)
+ Audio::Opusfile of;
+ int gain_type;
+ int gain_offset_q8;
+POSTCALL:
+ if(RETVAL)
+ croak("op_set_gain_offset returned error %d\n", RETVAL);
+
+void
+op_set_dither_enabled(of, enabled)
+ Audio::Opusfile of;
+ int enabled;
+
+
+void
+op_read(of, bufsize = 1024 * 1024)
+ Audio::Opusfile of;
+ int bufsize;
+PREINIT:
+ opus_int16* buf;
+ int li, ret, chans, i;
+PPCODE:
+ Newx(buf, bufsize, opus_int16);
+ ret = op_read(of, buf, bufsize, &li);
+ if(ret < 0)
+ croak("op_read returned error %d\n", ret);
+ chans = op_channel_count(of, li);
+ EXTEND(SP, chans * ret + 1);
+ PUSHs(sv_2mortal(newSViv(li)));
+ for(i = 0 ; i < chans * ret ; i++)
+ PUSHs(sv_2mortal(newSViv(buf[i])));
+
+void
+op_read_float(of, bufsize = 1024 * 1024)
+ Audio::Opusfile of;
+ int bufsize;
+PREINIT:
+ float* buf;
+ int li, ret, chans, i;
+PPCODE:
+ Newx(buf, bufsize, float);
+ ret = op_read_float(of, buf, bufsize, &li);
+ if(ret < 0)
+ croak("op_read_float returned error %d\n", ret);
+ chans = op_channel_count(of, li);
+ EXTEND(SP, chans * ret + 1);
+ PUSHs(sv_2mortal(newSViv(li)));
+ for(i = 0 ; i < chans * ret ; i++)
+ PUSHs(sv_2mortal(newSVnv(buf[i])));
+
+void
+op_read_stereo(of, bufsize = 1024 * 1024)
+ Audio::Opusfile of;
+ int bufsize;
+PREINIT:
+ opus_int16* buf;
+ int ret, i;
+PPCODE:
+ Newx(buf, bufsize, opus_int16);
+ ret = op_read_stereo(of, buf, bufsize);
+ if(ret < 0)
+ croak("op_read_stereo returned error %d\n", ret);
+ EXTEND(SP, 2 * ret);
+ for(i = 0 ; i < 2 * ret ; i++)
+ PUSHs(sv_2mortal(newSViv(buf[i])));
+
+void
+op_read_float_stereo(of, bufsize = 1024 * 1024)
+ Audio::Opusfile of;
+ int bufsize;
+PREINIT:
+ float* buf;
+ int ret, i;
+PPCODE:
+ Newx(buf, bufsize, float);
+ ret = op_read_float_stereo(of, buf, bufsize);
+ if(ret < 0)
+ croak("op_read_float_stereo returned error %d\n", ret);
+ EXTEND(SP, 2 * ret);
+ for(i = 0 ; i < 2 * ret ; i++)
+ PUSHs(sv_2mortal(newSVnv(buf[i])));
+
+