initial import
This commit is contained in:
38
speex/PKGBUILD
Normal file
38
speex/PKGBUILD
Normal file
@@ -0,0 +1,38 @@
|
||||
# Maintainer: Jesus E. <heckyel@riseup.net>
|
||||
|
||||
pkgname=speex
|
||||
pkgver=1.2.0
|
||||
pkgrel=2
|
||||
pkgdesc="A free codec for free speech"
|
||||
arch=(i686 x86_64)
|
||||
url="https://speex.org/"
|
||||
license=(Modified-BSD)
|
||||
depends=(libogg speexdsp libsndio)
|
||||
source=(https://downloads.us.xiph.org/releases/$pkgname/$pkgname-$pkgver.tar.gz
|
||||
sndio.patch)
|
||||
sha512sums=('7fe10838c7d1bafcbe42295b82b79262420dba793b8a4388e2f73a3007850b5572face1b5308d9f4e8d7dfc9cb1c016cbad88cd65b2892667986107ed946836b'
|
||||
'265bee624bc1a88ac41cd67b43e7f9b08da74710c951d0a706b23e2081f598fda91cb333deea16af17d1d12fa77b15c6755c4f9c83e1954fef93ab8f8e5ac849')
|
||||
|
||||
prepare() {
|
||||
cd $pkgname-$pkgver
|
||||
patch -p1 -i ../sndio.patch
|
||||
}
|
||||
|
||||
build() {
|
||||
export CPPFLAGS+=" -DUSE_SNDIO"
|
||||
cd $pkgname-$pkgver
|
||||
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static \
|
||||
--enable-binaries # Must be given or configure won't use pkg-config correctly
|
||||
make
|
||||
}
|
||||
|
||||
check() {
|
||||
cd $pkgname-$pkgver
|
||||
make -k check
|
||||
}
|
||||
|
||||
package() {
|
||||
cd $pkgname-$pkgver
|
||||
make DESTDIR="$pkgdir" install
|
||||
install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
|
||||
}
|
||||
82
speex/sndio.patch
Normal file
82
speex/sndio.patch
Normal file
@@ -0,0 +1,82 @@
|
||||
diff --git a/src/Makefile.in b/src/Makefile.in
|
||||
index 58394ed..55fec35 100644
|
||||
--- a/src/Makefile.in
|
||||
+++ b/src/Makefile.in
|
||||
@@ -370,7 +370,7 @@ speexenc_LDADD = $(top_builddir)/libspeex/libspeex.la \
|
||||
|
||||
speexdec_SOURCES = speexdec.c wav_io.c
|
||||
speexdec_LDADD = $(top_builddir)/libspeex/libspeex.la \
|
||||
- $(OGG_LIBS) @WINMM_LIBS@ @FFT_LIBS@
|
||||
+ $(OGG_LIBS) @WINMM_LIBS@ @FFT_LIBS@ -lsndio
|
||||
|
||||
all: all-am
|
||||
|
||||
diff --git a/src/speexdec.c b/src/speexdec.c
|
||||
index 4721dc1..c5c39a3 100644
|
||||
--- a/src/speexdec.c
|
||||
+++ b/src/speexdec.c
|
||||
@@ -67,6 +67,9 @@
|
||||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
+#elif defined USE_SNDIO
|
||||
+#include <sndio.h>
|
||||
+
|
||||
#elif defined HAVE_SYS_AUDIOIO_H
|
||||
#include <sys/types.h>
|
||||
#include <fcntl.h>
|
||||
@@ -91,6 +94,10 @@
|
||||
((buf[base+1]<<8)&0xff00)| \
|
||||
(buf[base]&0xff))
|
||||
|
||||
+#ifdef USE_SNDIO
|
||||
+struct sio_hdl *hdl;
|
||||
+#endif
|
||||
+
|
||||
static void print_comments(char *comments, int length)
|
||||
{
|
||||
char *c=comments;
|
||||
@@ -186,6 +193,32 @@ FILE *out_file_open(char *outFile, int rate, int *channels)
|
||||
exit(1);
|
||||
}
|
||||
fout = fdopen(audio_fd, "w");
|
||||
+#elif defined USE_SNDIO
|
||||
+ struct sio_par par;
|
||||
+
|
||||
+ hdl = sio_open(NULL, SIO_PLAY, 0);
|
||||
+ if (!hdl)
|
||||
+ {
|
||||
+ fprintf(stderr, "Cannot open sndio device\n");
|
||||
+ exit(1);
|
||||
+ }
|
||||
+
|
||||
+ sio_initpar(&par);
|
||||
+ par.sig = 1;
|
||||
+ par.bits = 16;
|
||||
+ par.rate = rate;
|
||||
+ par.pchan = *channels;
|
||||
+
|
||||
+ if (!sio_setpar(hdl, &par) || !sio_getpar(hdl, &par) ||
|
||||
+ par.sig != 1 || par.bits != 16 || par.rate != rate) {
|
||||
+ fprintf(stderr, "could not set sndio parameters\n");
|
||||
+ exit(1);
|
||||
+ }
|
||||
+ *channels = par.pchan;
|
||||
+ if (!sio_start(hdl)) {
|
||||
+ fprintf(stderr, "could not start sndio\n");
|
||||
+ exit(1);
|
||||
+ }
|
||||
#elif defined HAVE_SYS_AUDIOIO_H
|
||||
audio_info_t info;
|
||||
int audio_fd;
|
||||
@@ -746,6 +779,10 @@ int main(int argc, char **argv)
|
||||
if (strlen(outFile)==0)
|
||||
WIN_Play_Samples (out+frame_offset*channels, sizeof(short) * new_frame_size*channels);
|
||||
else
|
||||
+#elif defined USE_SNDIO
|
||||
+ if (strlen(outFile)==0)
|
||||
+ sio_write (hdl, out+frame_offset*channels, sizeof(short) * new_frame_size*channels);
|
||||
+ else
|
||||
#endif
|
||||
fwrite(out+frame_offset*channels, sizeof(short), new_frame_size*channels, fout);
|
||||
|
||||
Reference in New Issue
Block a user