Skip to main content

Topic: Recombining .wv+.wvc into a single .wv (Read 2145 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • darkbyte
  • [*][*][*]
Recombining .wv+.wvc into a single .wv
Today i was reading the basswv decoder's API and noticed that decoding a WavPack with the optional correction file applied only happens if i decode Wavpack from the filesystem, i cannot supply a secondary input if i like to stream the .wv+.wvc combo over HTTP for example.

I wonder however if it's possible to combine the .wv and .wvc files into a single .wv stream by "merging" the two file stream? I'm affraid this can be only achieved by losslessly transcoding again to Wavpack without Hybrid encoding and this requires significant CPU power compared to a simple stream merging.

You might wonder why is this interesting. Imagine an audio server where you have your audio files in Wavpack hybrid compressed. For streaming over the internet, the lossy part is a good choice and a sync app could easily download these to a DAP or phone. However at home we have  the network bandwidth to stream to our devices in lossless. To overcome the single stream input a server side script or application could easily merge the two files into one on-the-fly. This could be even done by a Raspberry Pi.
  • Last Edit: 19 June, 2014, 12:10:01 PM by darkbyte
WavPack -b4x4hc
Opus --cvbr --bitrate 256 --framesize 5

  • bryant
  • [*][*][*][*][*]
  • Developer (Donating)
Recombining .wv+.wvc into a single .wv
Reply #1
You are correct in that there is no way to “merge” the lossy and the correction files together without decoding and re-encoding. However, since we are (I assume) talking about real time streaming, the CPU load would not be more than a few percent on anything but the lowest powered device (you would not use any “extra” mode on the recode).

Of course, once you had decoded to PCM, it might make more sense to just stream that rather than re-encode to anything. I guess it depends on the client capabilities and the actual physical network (i.e. 802.11g or GbE, a switch I recently made at home that I will not regret).

  • darkbyte
  • [*][*][*]
Recombining .wv+.wvc into a single .wv
Reply #2
At home i have a low power Atom N270 based server which consumes only 15W with a 2.5" drive but it's CPU capabilities are limited. For example I've measured transcoding form CDDA FLAC to Musepack (because Musepack encoders and decoders are among the fastest) and it's encoding at 5x speeds. My quad core AMD does the same at 100x+ speeds. I don't think that say a Raspberry Pi is more powerful either in this manner. So by these low end machines clearly the simple file merging would be the best.

The decode and stream as PCM way is interesting though. I haven't though about that. However decoding is still have to be done at the resource limited server. CDDA PCM should be not an issue for any network to stream. I'm not working with higher than CDDA resolution audio.
WavPack -b4x4hc
Opus --cvbr --bitrate 256 --framesize 5