After searching the web I found the Tcl package SNACK https://www.speech.kth.se/snack/download.html, that I could use the generate a sound signal (sinus shaped and wanted frequency).
On the other side, the project seems to be dead.
Are there other packages out there for sound signal generation.
On Friday, September 10, 2021 at 10:48:42 PM UTC+10, Alexandru wrote:
After searching the web I found the Tcl package SNACK https://www.speech.kth.se/snack/download.html, that I could use the generate a sound signal (sinus shaped and wanted frequency).
On the other side, the project seems to be dead.I used Snack recently for making a "Pitch Pipe" Android app for tuning my guitar. It certainly works and ought to do what you want.
Are there other packages out there for sound signal generation.
On Friday, September 10, 2021 at 10:48:42 PM UTC+10, Alexandru wrote:
After searching the web I found the Tcl package SNACK https://www.speech.kth.se/snack/download.html, that I could use the generate a sound signal (sinus shaped and wanted frequency).
On the other side, the project seems to be dead.I used Snack recently for making a "Pitch Pipe" Android app for tuning my guitar. It certainly works and ought to do what you want.
Are there other packages out there for sound signal generation.
I tried to run snack on Windows 10 64bit and it fails with
couldn't load library "C:/Tcl/lib/snack2.2.10/libsnack.dll": Bad exe format. Possibly a 32/64-bit mismatch.
We're building snack on Windows for both 32bit and 64bit,
with msys/configure and MSVC 2019. We fiddle with the generated
Makefiles a bit (replace -I/c/some/path by -Ic:/some/path, -ltclstub by tclstub.lib etc via sed), so it should be feasible with mingw, too.
0x39a45a0 <ReadMP3Samples+7904>: movl $0x0,(%rax)0x39a45a6 <ReadMP3Samples+7910>: add $0x4,%rax
0x3ab45a0 <ReadMP3Samples+7904>: movl $0x0,(%rax)0x3ab45a6 <ReadMP3Samples+7910>: add $0x4,%rax
Sorry, I'll correct that. After removing the old library from the Tcl/lib directory (I'd mistakenly renamed it with -old suffix but Tk was still picking it up), I ran my test and it passes. It's plays an MP3 file. So after turning off optimisation I amable to build and run both 32 and 64 bit builds. More work needs to be done to work out what level of optimisation will work and why, but it does work. I havn't tried Snack's tests yet either.
Alexandru would you like a copy of the -64 bit library to test?Hi Scotty,
I've put a copy of the 64 bit binary library on my Google Drive as snack2.2.10-Windows-amd64-debug-no_opt.tar.gz.
It's compiled without optimisation and with debug symbols.
Link: https://drive.google.com/file/d/1xuLFPS1sR-vrwMyRq3H_bYwLB3Sk2HCJ/view?usp=sharing
Plus another patch which also resulted in SEGVs:
*** snack2.2.10/generic/jkSoundEngine.c~ Wed Dec 1 15:23:46 2004
Alexandru would you like a copy of the -64 bit library to test?Hi Scotty,
of course. Thank you!
Alexandru would you like a copy of the -64 bit library to test?Hi Scotty,
of course. Thank you!Hi Scotty,
I'm building a version of Wavesurfer for bioacoustics in 32bits. But I would like a 64-bit version and I need snack: is your patch for the 64-bit version of snack still available? The link no longer works. It would be great...
Yann
On Thursday, January 5, 2023 at 9:27:19 PM UTC+11, Yann-Erwan Trévilly wrote:
Hi Scotty,Alexandru would you like a copy of the -64 bit library to test?Hi Scotty,
of course. Thank you!
I'm building a version of Wavesurfer for bioacoustics in 32bits. But I would like a 64-bit version and I need snack: is your patch for the 64-bit version of snack still available? The link no longer works. It would be great...
Yann
Hi Yann,
I've uploaded it to Github. Please see if any of the binaries on this page help you: https://github.com/scottypitcher/tcl-snack/releases
Kind regards,
Scott
Hi Scott,
I'm trying to include your Snack version into my BAWT framework.
It compiles and runs fine on Windows 11 using MinGW/gcc in 32-bit and 64-bit.
(I had to replace the "mkdir" call with "mkdir -p" in Makefile.in).
When compiling on Linux with default configure options, I get the following error when starting snack:
"Unable to open mixer /dev/mixer"
and the following error when trying to run demo generator.tcl:
"Could not gain access to /dev/sound/dsp for writing"
When configuring with "--enable-alsa" I get the following error when starting snack:
undefined symbol: _snd_pcm_mmap_hw_ptr
while executing "load /opt/Tcl/lib/snack2.2.11/libsnack.so"
Which configure option are you using and which Linux distribution does it run for you?
Thanks,
Paul
* Paul Obermeier <obermeier@poSoft.de>
| When configuring with "--enable-alsa" I get the following error when starting snack:
| undefined symbol: _snd_pcm_mmap_hw_ptr
| while executing "load /opt/Tcl/lib/snack2.2.11/libsnack.so"
| Which configure option are you using and which Linux distribution does it run for you?
FWIW,
we use snack2.2.10 (without MP3 which we don't need) on OpenSuse 15.4
and Debian 11.
Here are the patches that we apply to snack2.2.10:
==================================================
--- snack2.2.10/generic/jkSoundEngine.c.orig
+++ snack2.2.10/generic/jkSoundEngine.c
@@ -1694,7 +1694,7 @@
if (soundQueue != NULL) {
for (p = soundQueue; p != NULL && p->sound != s; p = p->next);
- if (p->sound == s) {
+ if (p && p->sound == s) {
n = p->startPos + p->nWritten;
}
}
==================================================
# https://bugs.gentoo.org/show_bug.cgi?id=226137
# + double-close-protection
--- snack2.2.10/unix/jkAudIO_alsa.c.orig
+++ snack2.2.10/unix/jkAudIO_alsa.c
@@ -49,6 +49,8 @@
static int minNumChan = 1;
+static snd_pcm_uframes_t hw_bufsize = 0;
+
int
SnackAudioOpen(ADesc *A, Tcl_Interp *interp, char *device, int mode, int freq,
int nchannels, int encoding)
@@ -135,6 +137,9 @@
Tcl_AppendResult(interp, "Failed setting HW params.", NULL);
return TCL_ERROR;
}
+
+ snd_pcm_hw_params_get_buffer_size (hw_params, &hw_bufsize);
+
snd_pcm_hw_params_free(hw_params);
snd_pcm_prepare(A->handle);
if (A->mode == RECORD) {
@@ -155,9 +160,11 @@
{
if (A->debug > 1) Snack_WriteLog(" Enter SnackAudioClose\n");
- snd_pcm_drop(A->handle);
- snd_pcm_close(A->handle);
-
+ if (A->handle) {
+ snd_pcm_drop(A->handle);
+ snd_pcm_close(A->handle);
+ A->handle = NULL;
+ }
if (A->debug > 1) Snack_WriteLog(" Exit SnackAudioClose\n");
return(0);
@@ -202,6 +209,8 @@
int i;
static char buf[64];
+ return;
+
if (A->debug > 1) Snack_WriteLog(" Enter SnackAudioPost\n");
for (i = 0; i < 1000; i++) {
@@ -267,12 +276,14 @@
long
SnackAudioPlayed(ADesc *A)
{
- long avail = _snd_pcm_mmap_hw_ptr(A->handle);
+ // FIX Here, _snd_pcm_mmap_hw_ptr is deprecated in new alsalib
+ long played = A->nWritten - (hw_bufsize - SnackAudioWriteable(A));
+ // long avail = _snd_pcm_mmap_hw_ptr(A->handle);
- if (avail < 0)
- avail = 0;
+ if (played < 0)
+ return 0;
- return (avail+A->nPlayed);
+ return (played);
}
void
==================================================
HTH
R'
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 285 |
Nodes: | 16 (2 / 14) |
Uptime: | 27:41:59 |
Calls: | 6,448 |
Files: | 12,050 |
Messages: | 5,254,475 |