Faster version of a function that converts from base 256

from=Compile[{{x,_Integer,1}},Module[{i,exp=1,ans=0},For[i=1,i≤Length[x],i++,ans=ans+exp*x[[i]];exp=exp*256];
ans],CompilationTarget->"C"];

Faster version of a function that extracts the data segment

getData=Compile[{{x,_Integer,1}},
from/@Partition[x[[45;;-1]],2],CompilationOptions->{"InlineExternalDefinitions"->True}
];

This file happens to have only one data chunk, so we can cheat by just returning that chunk.

parse[file_]:=With[{channelsNum=from@file[[23;;24]],sampleRate=from@file[[25;;28]],n1=from@file[[29;;32]]},
Assert[file[[1;;4]]==ToCharacterCode@"RIFF"];
Assert[file[[9;;12]]==ToCharacterCode@"WAVE"];
Assert[file[[13;;15]]==ToCharacterCode@"fmt"];
Assert[file[[16]]==0];
Assert[from@file[[35;;36]]==16];
Assert[file[[37;;40]]==ToCharacterCode@"data"];
<|"DataSize"->from@file[[41;;44]],"BitsPerSample"->8 (n1/(channelsNum sampleRate)),"Channels"->channelsNum,"SampleRate"->sampleRate,"FormatType"->from@file[[21;;22]],"FileSize"->from@file[[5;;8]],"DataSize"->from@file[[41;;44]],"FormatSize"->from@file[[17;;20]],
"Data"->Hold[getData@bytes]|>
]

bytes=BinaryReadList["tiny_planet.wav"];

parsed=parse[bytes]

d=FromDigits[#,2]&/@Partition[Mod[ReleaseHold[parsed[["Data"]]],2],8];

With[{stream=OpenWrite[BinaryFormat->True]},
PrintTemporary["Writing to disk"];
BinaryWrite[stream,d];
PrintTemporary["Written."];
Close[stream]]

Open this up and you get an image of Audacity’s Nyquist prompt with the command “(mult *track* (hsosc 17500.0))” ready to run.