fiduciary

Author Topic: Freeware for audio splice/concatenation  (Read 2165 times)

0 Members and 1 Guest are viewing this topic.

Offline Obi_1

  • Mining Colony Members
  • Experienced Force User
  • *
  • Posts: 476
  • Creator of DIYino - first open source FX-board
Freeware for audio splice/concatenation
« on: July 17, 2017, 04:57:02 AM »
Dear Saber Font Artists,

I need your help! I'm looking for a free software with very simple functionalities:
- splice existing Wav files i.e. cut them somewhere in between
- merge/join 2 Wav files together

I could do it with Audacity, problem is, that that damned software resamples the files and the resulting sound sounds less clean than the input files.

Any idea which software could be used?

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: Freeware for audio splice/concatenation
« Reply #1 on: July 17, 2017, 10:36:30 AM »
Wait what? What action causes Audacity to resample?

Offline Obi_1

  • Mining Colony Members
  • Experienced Force User
  • *
  • Posts: 476
  • Creator of DIYino - first open source FX-board
Re: Freeware for audio splice/concatenation
« Reply #2 on: July 17, 2017, 12:34:29 PM »
Frankly, I dunno. I recognized it during the time I added hum to some of the sound fonts I own, to be compatible with the DIYino boards. I was wondering how come the sound quality was inferior to how they sounded like in original on the PC. I despaired...until Jakesoft introduced his app to append hum automatically. For the first time I had sounds unaltered, and they sounded all of a sudden clear and crisp.

So here is my case: Jake's app makes a magnificient job of adding hum to the sounds. It always adds one hum length, which is perfect. However some sound fonts have exteremly long hum sounds, some justified because the whole is unique, some just repeats the same sequence over and over again. These latter I would like to shorted to about 3-5 secs, with which I could convert the sound fonts to be compatible with my board which comes with SPI flash. With optimized lenght I could squeeze in up to 3 sound fonts, which is my goal. I already have a working build with 3, but so far I only have the xxx resamples version from Audacity.

Of course if there is any way to get rid of this annoying feature, so much better.

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: Freeware for audio splice/concatenation
« Reply #3 on: July 17, 2017, 02:55:07 PM »
I don't understand why you would want to tack on hum to the end of the wav files. Is the DFUplayer not able to do gapless playback?

It wouldn't be difficult to write something in python, or even a shell script using "sox" that could do this.
I still don't think Audacity does any resampling unless you ask it to, but I could be wrong, I haven't used it that much.




Offline Obi_1

  • Mining Colony Members
  • Experienced Force User
  • *
  • Posts: 476
  • Creator of DIYino - first open source FX-board
Re: Freeware for audio splice/concatenation
« Reply #4 on: July 20, 2017, 09:33:02 PM »
I will bring up the topic to Jakesoft, he is the master of software solutions for lightsabers. I agree Audacity should not do resampling, and you can even set sample rate, however still the end result is reproducably deteriorated compared to the original. And I do not want to alter the fonts, just play around with hum lenghts.

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: Freeware for audio splice/concatenation
« Reply #5 on: July 21, 2017, 05:03:27 PM »
Here is a bash script that will concatenate the non-repeating portion of the hum to all the files.

Code: [Select]
#!/bin/bash                                                                                                                                                                                                                 

set -e -x

OUT=fixed_files
HUM=hum.wav
HUMLEN=$(soxi -s "$HUM")
HUMRATE=$(soxi -r "$HUM")
repeats=$[HUMLEN / $HUMRATE]
while [ $repeats -gt 1 ]; do
  if [ "$[$HUMLEN % $repeats]" == 0 ]; then
    L="$[HUMLEN / $repeats]"
    sox "$HUM" humtmp1.wav trim "0s" "$L"s
    sox "$HUM" humtmp2.wav trim "$L"s "$L"s
    if cmp humtmp1.wav humtmp2.wav; then
      HUM=humtpm1.wav
      break;
    else:
      rm humtmp1.wav humtmp2.wav
    fi
  fi
  repeats="$[$repeats - 1]"
done


mkdir -p "$OUT"

for file in *.wav; do
  case "$file" in
    humtmp1.wav)
      continue
    ;;
    humtmp2.wav)
      continue
    ;;
    poweroff.wav)
      continue
    ;;
    hum.wav)
      continue
    ;;
  esac
  sox --combine concatenate "$file" "$HUM" "$OUT/$file"
done

rm -f humtmp1.wav humtmp2.wav


Offline Obi_1

  • Mining Colony Members
  • Experienced Force User
  • *
  • Posts: 476
  • Creator of DIYino - first open source FX-board
Re: Freeware for audio splice/concatenation
« Reply #6 on: July 24, 2017, 12:55:01 PM »
Awesome profezzorn! I'm in your dept. Although Jakesoft's conversion program does the same, I will use it to learn bash. Will it work under Windows as well?

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: Freeware for audio splice/concatenation
« Reply #7 on: July 24, 2017, 01:38:47 PM »
It should work in cygwin on Windows.

 

retrousse