[Speex-dev] Upsampling while decoding / Updating

Nikos Chantziaras realnc at gmail.com
Wed May 8 09:18:06 PDT 2013


I'm not using Opus at all.  I'm just including its resampler in my own 
sources.  It's not even a DLL; it's directly compiled together with the 
rest of my code.  You need these sources from the opus-tools package 
(http://www.opus-codec.org/downloads/):

   arch.h resample.c resample_sse.h speex_resampler.h stack_alloc.h

In your project file, define these macros:

   #define SPX_RESAMPLE_EXPORT
   #define OUTSIDE_SPEEX
   #define RANDOM_PREFIX NAME_OF_YOUR_SOFTWARE

If your software is actually a library itself, you might to instead:

   #define SPX_RESAMPLE_EXPORT __declspec(dllexport)

or whatever else you happen to be using.

With that, you should be able to include the source files directly in 
your project and build them without issues.  The license is a two clause 
BSD-style permissive one, so you can do that.


On 08/05/13 07:38, Hermann Weber wrote:
> Dear Nikos,
>
> thanks!
> But you use Opus only for resampling, not for entirely replacing Speex,
> don't you?
>
> Greetings!
> Hermie
>
> Am 07.05.2013 22:53, schrieb Nikos Chantziaras:
>> The Opus resampler is actually a bugfixed version of the Speex one. Same
>> interface/API, but with the bugs removed.  It's why I recommended it :-)
>>     Otherwise I would have recommended something entirely different, like
>> SoXR.
>>
>>
>> On 07/05/13 22:12, Hermann Weber wrote:
>>> Dear Nikos,
>>>
>>> thank you very much for your advice!
>>>
>>> I am not a little bit new to C++, and experiments (like using another
>>> third party library) always turn out to be days of work for me.
>>> That is why I would first like to try Speex's new internal resampling
>>> function.
>>>
>>> I am currently still using the old 1.0.4 version.
>>>
>>> I have now downloaded the new 1.2rc1 version.
>>> Unfortunately it does not want to compile the libspeex.dll right away,
>>> VS2010 tells me:
>>>
>>> Converting project file
>>> 'C:\Users\MyUser\Desktop\speex-1.2rc1\win32\VS2008\libspeex\libspeex.vcproj'.
>>>
>>> Failed to upgrade platform 'Windows Mobile 5.0 Pocket PC SDK (ARMV4I)'.
>>> Please make sure you have it installed under
>>> '%vctargetspath%\platforms\Windows Mobile 5.0 Pocket PC SDK (ARMV4I)'
>>> VCWebServiceProxyGeneratorTool is no longer supported. The tool has been
>>> removed from your project settings.
>>> Failed to upgrade 'Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)'.
>>> Please make sure you have the corresponding platform installed under
>>> '%vctargetspath%\platforms\Windows Mobile 5.0 Pocket PC SDK (ARMV4I)'
>>> The project configuration dimension name/value "(Platform, Win32)" was
>>> not found in the project manifest.
>>>
>>> Is it possible to compile the libspeex.dll without support for Windows
>>> Mobile 5.0, or is there no other way?
>>> I am afraid of messing anything up by install it.
>>>
>>> Greetings!
>>> Hermie
>>>
>>> Am 07.05.2013 16:03, schrieb Nikos Chantziaras:
>>>> On 07/05/13 13:07, Hermann Weber wrote:
>>>>> Hello!
>>>>>
>>>>> I would like to know if it is possible to request encoding to a higher
>>>>> samplerate than the original data.
>>>>> For example my uncompressed data was 22 kHz, and I would now like to
>>>>> decode the compressed data to 48 kHz (to feed it to a filter which
>>>>> expects a high "input" format).
>>>>> Is this possible with Speex?
>>>> Speex comes with a resampler, so yes. You need to resample your signal
>>>> after decoding it.
>>>>
>>>> However, I'd recommend using the Opus resampler instead of the Speex
>>>> one.  (It can be used stand-alone and directly included in your own code.)




More information about the Speex-dev mailing list