Re: [Sndobj-devel] PVA / PVS and 8 bit audiofiles
Status: Abandoned
Brought to you by:
veplaini
From: <Vic...@nu...> - 2011-02-15 08:39:36
|
What OS? The problem might be the RT output that is not working well in 8 bits. Try to make the output always 16 bits, as it should not depend on the input. Victor ----- Original Message ----- From: Ben Zonneveld <whi...@gm...> Date: Monday, February 14, 2011 11:25 pm Subject: [Sndobj-devel] PVA / PVS and 8 bit audiofiles To: snd...@li... > When trying to do some PVA / PVS stuff on a 8 bit mono audio file the only ouput i get is lots of distortion. > The program I am working on can't use 16 bit samples because the program is for editing sounds from an 8 bit midi sampler. > > At this moment I'm a bit stuck. > > I'm testing with the blurring example: > #include <SndObj/AudioDefs.h> > #include <stdio.h> > > int > main(){ > int vecsize=DEF_VECSIZE; > int fftsize=1024; > > int encoding=BYTESAM; > SndWave input("C:/Ableton Songs/Blunt Rips/Fairlight/GrandA4.wav", READ,1,8,0,0,DEF_VECSIZE); // 8 bit mono sample > // SndWave input("C:/Ableton Songs/Library/Legs 1.wav", READ,1,8,0,0,DEF_VECSIZE); // 16 bit stereo sample > float sr=input.GetSr(); > > if ( input.GetSize() == 8 ) > { > encoding = BYTESAM; > } else { > encoding = SHORTSAM; > } > > SndRTIO output(2, SND_OUTPUT,DEF_BSIZE,DEF_PERIOD,encoding,0,vecsize,sr); > > HammingTable window(fftsize, 0.54f); > > SndIn in(&input,1,vecsize,sr); > PVA anal(&window, &in,1.0f,fftsize,vecsize,sr); > // PVBlur blur(&anal, 0.05f,vecsize,fftsize,sr); > PVS synth(&window, &anal,fftsize,vecsize,sr); > > output.SetOutput(1, &synth); > output.SetOutput(2, &synth); > > > while(!input.Eof()){ > > input.Read(); > in.DoProcess(); > anal.DoProcess(); > // blur.DoProcess(); > synth.DoProcess(); > output.Write(); > } > > return 0; > > } > ----------------------------------------------------------------- > ------------- > The ultimate all-in-one performance toolkit: Intel(R) Parallel > Studio XE: > Pinpoint memory and threading errors before they happen. > Find and fix more than 250 security defects in the development cycle. > Locate bottlenecks in serial and parallel code that limit performance. > http://p.sf.net/sfu/intel-dev2devfeb> _______________________________________________ > Sndobj-devel mailing list > Snd...@li... > https://lists.sourceforge.net/lists/listinfo/sndobj-devel Dr Victor Lazzarini, Senior Lecturer, Dept. of Music, National University of Ireland, Maynooth |