aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2024-04-22 13:45:08 +0300
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2024-04-22 13:45:08 +0300
commit727dc577270e0dbbd7110236e129bb4e4dfcd099 (patch)
treead5fbba8618343f788a93b010a3d9822f3ea5791
parent13efbb4af83d366c092635e1da103eb0a4730f54 (diff)
downloadapplause2-727dc577270e0dbbd7110236e129bb4e4dfcd099.tar.gz
libsndfile moved to Github and updated the format enum - it now supports MP3
* SF_FORMAT is now up to date with libsndfile v1.2.2.
-rw-r--r--sndfile-stream.lua4
-rw-r--r--sndfile.lua15
2 files changed, 17 insertions, 2 deletions
diff --git a/sndfile-stream.lua b/sndfile-stream.lua
index ba5a0f3..59b4b04 100644
--- a/sndfile-stream.lua
+++ b/sndfile-stream.lua
@@ -4,7 +4,7 @@
local sndfile = require "sndfile"
--- Stream for reading a sound file.
--- This can be used with all file types supported by [libsndfile](http://www.mega-nerd.com/libsndfile/#Features).
+-- This can be used with all file types supported by [libsndfile](http://libsndfile.github.io/libsndfile/#features).
-- @type SndfileStream
SndfileStream = DeriveClass(Stream)
@@ -18,7 +18,7 @@ SndfileStream = DeriveClass(Stream)
-- Number of channels in file.
-- This is ignored unless reading files in ffi.C.SF_FORMAT_RAW.
-- @tparam[opt] SF_FORMAT format
--- Format of file to read ([C type](http://www.mega-nerd.com/libsndfile/api.html)).
+-- Format of file to read ([C type](http://libsndfile.github.io/libsndfile/api.html)).
-- If omitted, this guessed from the file extension.
-- @treturn SndfileStream|MuxStream
-- @see Stream:save
diff --git a/sndfile.lua b/sndfile.lua
index 1e6f6b7..b17afd2 100644
--- a/sndfile.lua
+++ b/sndfile.lua
@@ -39,6 +39,7 @@ typedef enum SF_FORMAT { /* Major formats. */
SF_FORMAT_OGG = 0x200000, /* Xiph OGG container */
SF_FORMAT_MPC2K = 0x210000, /* Akai MPC 2000 sampler */
SF_FORMAT_RF64 = 0x220000, /* RF64 WAV file */
+ SF_FORMAT_MPEG = 0x230000, /* MPEG-1/2 audio stream */
/* Subtypes from here on. */
@@ -60,6 +61,10 @@ typedef enum SF_FORMAT { /* Major formats. */
SF_FORMAT_GSM610 = 0x0020, /* GSM 6.10 encoding. */
SF_FORMAT_VOX_ADPCM = 0x0021, /* OKI / Dialogix ADPCM */
+ SF_FORMAT_NMS_ADPCM_16 = 0x0022, /* 16kbs NMS G721-variant encoding. */
+ SF_FORMAT_NMS_ADPCM_24 = 0x0023, /* 24kbs NMS G721-variant encoding. */
+ SF_FORMAT_NMS_ADPCM_32 = 0x0024, /* 32kbs NMS G721-variant encoding. */
+
SF_FORMAT_G721_32 = 0x0030, /* 32kbs G721 ADPCM encoding. */
SF_FORMAT_G723_24 = 0x0031, /* 24kbs G723 ADPCM encoding. */
SF_FORMAT_G723_40 = 0x0032, /* 40kbs G723 ADPCM encoding. */
@@ -73,6 +78,16 @@ typedef enum SF_FORMAT { /* Major formats. */
SF_FORMAT_DPCM_16 = 0x0051, /* 16 bit differential PCM (XI only) */
SF_FORMAT_VORBIS = 0x0060, /* Xiph Vorbis encoding. */
+ SF_FORMAT_OPUS = 0x0064, /* Xiph/Skype Opus encoding. */
+
+ SF_FORMAT_ALAC_16 = 0x0070, /* Apple Lossless Audio Codec (16 bit). */
+ SF_FORMAT_ALAC_20 = 0x0071, /* Apple Lossless Audio Codec (20 bit). */
+ SF_FORMAT_ALAC_24 = 0x0072, /* Apple Lossless Audio Codec (24 bit). */
+ SF_FORMAT_ALAC_32 = 0x0073, /* Apple Lossless Audio Codec (32 bit). */
+
+ SF_FORMAT_MPEG_LAYER_I = 0x0080, /* MPEG-1 Audio Layer I */
+ SF_FORMAT_MPEG_LAYER_II = 0x0081, /* MPEG-1 Audio Layer II */
+ SF_FORMAT_MPEG_LAYER_III = 0x0082, /* MPEG-2 Audio Layer III */
/* Endian-ness options. */