青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

Cpper
C/C++高級(jí)工程師 Android高級(jí)軟件工程師 IT集成工程師 音頻工程師 熟悉c,c++,java,c#,py,js,asp等多種語(yǔ)言 程序猿

#include <stdio.h>
#include 
<errno.h>
#include 
<string.h>
#include 
<unistd.h>
#include 
<fcntl.h>
#include 
<math.h>
#if defined(__OpenBSD__) || defined(__NetBSD__)
#include 
<soundcard.h>
#else
#include 
<sys/soundcard.h>
#endif
#include 
<sys/ioctl.h>
#include 
<sndfile.h>

#define BUFFER_LEN 4096

int _open_default_oss_device(char **dev_path,int id,int blocking);

int main(int argc,char *argv[])
{
    
if(argc<2)
        
return 0;

    SF_INFO info;
    SNDFILE
* file = sf_open(argv[1],SFM_READ,&info);
    
if(!file)
        
return 0;

    printf(
"samplerate:%d\n",info.samplerate);
    printf(
"channel:%d\n",info.channels);

    
char* dsp = NULL;
    
int dp = _open_default_oss_device(&dsp,0,0);
    if(dp < 0)
    {
        printf(
"dsp:%d\n",dp);
        perror("oss bad:");
        sf_close(file);
        return -1; 
    }
    
int tmp = info.channels;
    
int ret = ioctl(dp,SNDCTL_DSP_CHANNELS,&tmp);
    tmp 
= info.samplerate;
    ret 
= ioctl(dp,SNDCTL_DSP_SPEED,&tmp);
    tmp 
= AFMT_S16_LE;
    ioctl(dp,SNDCTL_DSP_SAMPLESIZE,
&tmp);

    
long  len = 0;
    
short buffer[BUFFER_LEN];
    
while((len=sf_read_short(file,buffer,BUFFER_LEN))!=0)
    {
        write(dp,(
char*)buffer,len*2);
    }

    close(dp);
    sf_close(file);
    free(dsp);
    
return 0;
}

int _open_default_oss_device(char **dev_path,int id,int blocking)
{
    
int fd;
    
char buf[80];

    
if(id>0)
    {
        sprintf(buf,
"/dev/sound/dsp%d",id);
        
if(!(*dev_path = strdup(buf)))
            
return -1;
    }
    
else
    {
        
if(!(*dev_path = strdup("/dev/sound/dsp")))
            
return -1;
    }

#ifdef BROKEN_OSS
    fd 
= open(*dev_path, O_WRONLY | O_NONBLOCK);
#else
    fd 
= open(*dev_path, O_WRONLY);
#endif

    
if(fd < 0)
    {
        free(
*dev_path);
        
if(id>0)
        {
            sprintf(buf,
"/dev/dsp%d",id);
            
if(!(*dev_path = strdup(buf)))
                
return -1;
        }
        
else
        {
            
if(!(*dev_path = strdup("/dev/dsp")))
                
return -1;
        }
#ifdef BROKEN_OSS
        fd 
= open(*dev_path, O_WRONLY | O_NONBLOCK);
#else
        fd 
= open(*dev_path, O_WRONLY);
#endif
    }

#ifdef BROKEN_OSS
    
if(fd >= 0 && blocking)
    {
        
if(fcntl(fd, F_SETFL, 0< 0)
        {
            close(fd);
            fd 
= -1;
        }
    }
#endif
    
if(fd < 0)
    {
        free(
*dev_path);
        
*dev_path = NULL;
    }
    
return fd;
}

只是在的我的ubuntu13.0.4下執(zhí)行執(zhí)行 ./text music.wav 會(huì)提示錯(cuò)誤 返回-1 提示 no such directory
在網(wǎng)上搜有人說(shuō)需要加載snd_pcm_oss
modprobe snd_pcm_oss
可我加載的時(shí)候提示
FATAL: Module snd_pcm_oss not found.
誰(shuí)知道這個(gè)如何弄?

另外查了下可以加載alsa-oss
之后調(diào)用aoss ./text music.wav來(lái)播放音樂(lè)
可以這個(gè)不是我要的,非命令行下不能加這個(gè)前綴
posted @ 2013-07-19 22:11 ccsdu2009 閱讀(1729) | 評(píng)論 (0)編輯 收藏
 
gaudio是一個(gè)基于C/C++混合編程的跨平臺(tái)音頻庫(kù),當(dāng)前支持windows32操作系統(tǒng)和linux32位操作系統(tǒng)

修改記錄
1.2013.04.01
    初次發(fā)布
2.2013.04.10
    完成對(duì)wav格式采樣頻率8000-48000,采樣格式4,8,16,24,32的支持     
3.2013.05.01
    a.版本提升為1.4.0.8
    b.修改一個(gè)退出異常
    c.支持二源混音
    d.使用載入插件的方式提供對(duì)wav播放的支持
    e.增加對(duì)au格式的支持
    f.增加echo音效
    g.增加bassboost音效
    h.增加函數(shù)gaudio_address_get
    i.增加使用例子:echo/mixer/stream/boost
    j.把設(shè)置,獲取音源三維空間信息的函數(shù)調(diào)整為: gaudio_source_set_float3,gaudio_source_get_float3
    k.修改解碼器結(jié)構(gòu)為回調(diào)模式
4.2013.05.10
    a.版本提升為1.6.8.0
    b.優(yōu)化部分代碼
    c.增加speedchanger音效
    d.增加音頻翻轉(zhuǎn)(g168)
    e.增加音頻聲道交換(g168)
    f.增加聲道合并(g168)
    g.增加speedchanger/invert測(cè)試用例
    h.增加vc調(diào)用靜態(tài)鏈接庫(kù)libgaudio.lib
    i.增加調(diào)制音效和測(cè)試?yán)?br />    j.修改解碼器框架
    k.修改獲取音頻采樣編碼格式不正確的問(wèn)題
    l.解決seek定位不準(zhǔn)的問(wèn)題
    m.增加音效鏈測(cè)試?yán)?br />    n.增加函數(shù)gaudio_set_long,gaudio_get_long
    o.修改stream例子
    p.支持壓縮mpc音頻格式
    q.支持ogg/vorbis格式
    r.修改獲取采樣格式錯(cuò)誤的bug
    t.增加接口說(shuō)明文檔    
5.2013.06.10
    a.版本提升為1.7.2.0
    b.gaudio_source_set_error_callback回調(diào)函數(shù)增加音源參數(shù)
    c.gaudio_source_set_finish_callback回調(diào)函數(shù)增加音源參數(shù)
    d.移除gaudio_get_version函數(shù)
    e.gaudio_effect_setcallback函數(shù)調(diào)整為gaudio_effect_set_callback
    f.使用插件式的音頻驅(qū)動(dòng)模式 - gwinmm
    g.gaudio代碼優(yōu)化
    h.增加音頻源碼率的獲取
    i.增加feature范例
    j.完善文檔
    k.增加對(duì)mp3的支持
    l.移除invert/modulator/bassboost例子
    m.增加balance
6.2013.07.07
    a.版本提升到1.8.0.2
    b.增加對(duì)交換文件aiff的支持
    c.修改音頻驅(qū)動(dòng)插件實(shí)現(xiàn)
    d.增加移相器音效
    e.修改部分API接口使用的long為int32_t以方便移植
    f.增加code::blocks測(cè)試工程
    g.增加msvc2008測(cè)試工程
    h.增加函數(shù)接口gaudio_source_create_from_buffer2以播放raw音頻數(shù)據(jù)
    i.把各個(gè)音效參數(shù)提到單獨(dú)文件
    j.簡(jiǎn)化wav解碼
    k.修改幾處內(nèi)存泄漏
    l.增加音頻回錄功能,輸出格式MP2,MP3,APE,WV,AAC,WAV,AU,AIFF,VOC,CAF,OGG
    當(dāng)前錄制信息:16位音頻,雙聲道,采樣頻率44100
    m.增加音頻回錄的例子recorder
    n.測(cè)試?yán)邮褂胓etopt和usage提示
    o.增加對(duì)tta格式的支持    
7.2013.07.28
    a.版本提升到1.9.8.6                   
    b.解決了wav,au,aiff播放進(jìn)度不準(zhǔn)的故障
    c.優(yōu)化wav/au/aiff解碼性能        
    d.增加distortion音效              
    e.增加foldback distortion音效       
    f.增加distortion音效使用例子       
    g.增加聲音穿透力                      
    h.修改結(jié)構(gòu)最大支持八聲道             
    i.增加portaudio插件驅(qū)動(dòng)(win32&linux)  
    j.完成g168,bassbost的liux版本     
    k.完成wav,au音頻格式的linux版本      
    l.代碼增加部分注釋(未完成)            
    m.嘗試性支持linux操作系統(tǒng)             
    n.支持midi/mid音樂(lè)格式             
    o.解決了mixer混音退出報(bào)錯(cuò)的問(wèn)題
    p.skip id3v2    
8.2013.08.16
    a.版本提升到2.0.0.1                    
    b.變量宏增加AUDIO_ENUM前綴
    c.增加非標(biāo)準(zhǔn)插件gsndfile支持flac/ogg/au/wav/aiff/voc/caf/..基于(sndfile)
    d.改用mpg123解碼mp3
    e.支持FFT頻譜
9.2013.09.08
    a.版本提升到2.0.6.0
    b.修改CROSSFEED宏和相關(guān)    
    c.引入200號(hào)插件支持s3m/mod/it/xm音頻格式
    d.整理測(cè)試用例
    e.增加autowah音效
    f.增加驅(qū)動(dòng)檢測(cè)
10.2015.12.10 版本2.2.1.0
支持常見(jiàn)音頻格式和音效,使用超級(jí)方便
下載在這里:/Files/gaimor/gaudio-sdk-2.2.1.0.zip

    
 
posted @ 2013-07-11 22:49 ccsdu2009 閱讀(6667) | 評(píng)論 (2)編輯 收藏
 
#include <stdio.h>
#include 
<string.h>
#include 
<ao/ao.h>
#include 
<libmad/mad.h>
#include 
<math.h>
#include 
<limits.h>

signed 
short to_short(mad_fixed_t fixed)
{
    
if(fixed>=MAD_F_ONE)
        
return(SHRT_MAX);
    
if(fixed<=-MAD_F_ONE)
        
return(-SHRT_MAX);
    
fixed=fixed>>(MAD_F_FRACBITS-15);
    
return((signed short)fixed);
}

unsigned 
char inputBuffer[4096 + MAD_BUFFER_GUARD];

class libMP3
{
public:
    libMP3(
const char* filename)
    {   
        file 
= fopen(filename,"rb");
        mad_stream_init(
&stream);
        mad_frame_init(
&frame);    
        mad_synth_init(
&synth);
        mad_timer_reset(
&timer);            
    }
    
    
~libMP3()
    {
        mad_synth_finish(
&synth);
        mad_frame_finish(
&frame);
        mad_stream_finish(
&stream); 
        fclose(file);            
    }   
    
    
int setup()
    {
        size_t    remaining;
        unsigned 
char* read;

        
if(stream.next_frame!=NULL)
        {
           remaining
=stream.bufend-stream.next_frame;
           memmove(inputBuffer,stream.next_frame,remaining);
           read 
= inputBuffer+remaining;
           readsize 
= 4096-remaining;
        }
        
else
           readsize 
= 4096,
        read 
= inputBuffer,
        remaining
=0;

        readsize 
= fread(read,1,readsize,file);
        
if(readsize<=0)
        {

           return -1;
        }
        
        mad_stream_buffer(
&stream,inputBuffer,readsize+remaining);
        
char dest[100];
        mad_timer_string(timer, dest, 
"%02lu:%02u:%02u", MAD_UNITS_HOURS, MAD_UNITS_MILLISECONDS, 0);
        stream.error
=(mad_error)0;
        
return 0;        
    }
    
long readFrame(unsigned char* pcm)
    {
        
if(stream.buffer == NULL)
        {
           
if(setup() == -1
               
return -1;
        }
    
while(mad_frame_decode(&frame,&stream) != 0)
    {
        
if(MAD_RECOVERABLE(stream.error))
        {
            
if(stream.error!=MAD_ERROR_LOSTSYNC)
            {

            }
            
continue;
        }
        
else
            
if(stream.error==MAD_ERROR_BUFLEN)
            {

                if (setup() == -1return -1;
                
continue;
            }
            
else
            {
                
return -1;
            }
    }
    mad_synth_frame(
&synth,&frame);

    
//! 獲取頻率
    
//freq = synth.pcm.samplerate; 
    
    
//bitrate = frame.header.bitrate;
    
//channels = (frame.header.mode == MAD_MODE_SINGLE_CHANNEL) ? 1 : 2;
    
    mad_timer_add(
&timer,frame.header.duration);
    
int j = 0;
 
    
for(int i=0;i<synth.pcm.length;i++)
    {
        signed 
short    sample;
        sample
=to_short(synth.pcm.samples[0][i]);
        pcm[j
++= sample&0xff;
        pcm[j
++= sample>>8;
        
if(MAD_NCHANNELS(&frame.header)==2)
            sample
=to_short(synth.pcm.samples[1][i]);
        pcm[j
++= sample&0xff;
        pcm[j
++= sample>>8;
    }

    
char dest[120];
    mad_timer_string(timer,dest, 
"%lu:%02lu.%03u", MAD_UNITS_MINUTES, MAD_UNITS_MILLISECONDS, 0);
    
return j;        
    }
private:
    
struct mad_stream    stream;
    
struct mad_frame    frame;
    
struct mad_synth    synth;
    
struct mad_header   header;
    mad_timer_t            timer;    
    FILE
* file;            
    
long readsize;     
};

int main(int argc, char **argv)
{       
    
int rate = 44100;
    
int channels = 2;
 
    unsigned 
char data[4096];
    ao_device 
*device;
    ao_sample_format format;
    
int default_driver;
    ao_initialize();

    default_driver 
= ao_default_driver_id();
    memset(
&format,0,sizeof(format));
    format.bits 
= 16;
    format.channels 
= channels;
    format.rate 
= rate;
    format.byte_format 
= AO_FMT_LITTLE;
    
    libMP3 mp3(
"我只在乎你.mp3");
    
    device 
= ao_open_live(default_driver,&format,NULL);
    
if(device == NULL) 
    {
        fprintf(stderr,
"error opening device.\n");
        
return 1;
    }
    
    
long len = 0;
    unsigned 
char buffer[4096*2];
    
while(len = mp3.readFrame(buffer))
    {
        ao_play(device,(
char*)buffer,len);          
    }
   
    ao_close(device);
    ao_shutdown();
    
return (0);
}
posted @ 2013-06-09 21:14 ccsdu2009 閱讀(1762) | 評(píng)論 (0)編輯 收藏
 
執(zhí)行sudo alsa force-reload
重啟電腦之后如果還不行執(zhí)行

sudo apt-get remove --purge alsa-base pulseaudio

sudo apt-get install alsa-base pulseaudio

最后sudo alsa force-reload
posted @ 2013-06-07 19:48 ccsdu2009 閱讀(727) | 評(píng)論 (0)編輯 收藏
 
gaudio是一個(gè)使用最方便的音頻播放庫(kù)
修改記錄
1.2013.04.01
    初次發(fā)布
2.2013.04.10
    完成對(duì)wav格式采樣頻率8000-48000,采樣格式4,8,16,24,32的支持     
3.2013.05.01
    a.版本提升為1.4.0.8
    b.修改一個(gè)退出異常
    c.支持二源混音
    d.使用載入插件的方式提供對(duì)wav播放的支持
    e.增加對(duì)au格式的支持
    f.增加echo音效
    g.增加bassboost音效
    h.增加函數(shù)gaudio_address_get
    i.增加使用例子:echo/mixer/stream/boost
    j.把設(shè)置,獲取音源三維空間信息的函數(shù)調(diào)整為: gaudio_source_set_float3,gaudio_source_get_float3
    k.修改解碼器結(jié)構(gòu)為回調(diào)模式
4.2013.05.10
    a.版本提升為1.6.8.0
    b.優(yōu)化部分代碼
    c.增加speedchanger音效
    d.增加音頻翻轉(zhuǎn)(g168)
    e.增加音頻聲道交換(g168)
    f.增加聲道合并(g168)
    g.增加speedchanger/invert測(cè)試用例
    h.增加vc調(diào)用靜態(tài)鏈接庫(kù)libgaudio.lib
    i.增加調(diào)制音效和測(cè)試?yán)?br />    j.修改解碼器框架
    k.修改獲取音頻采樣編碼格式不正確的問(wèn)題
    l.解決seek定位不準(zhǔn)的問(wèn)題
    m.增加音效鏈測(cè)試?yán)?br />    n.增加函數(shù)gaudio_set_long,gaudio_get_long
    o.修改stream例子
    p.支持壓縮mpc音頻格式
    q.支持ogg/vorbis格式
    r.修改獲取采樣格式錯(cuò)誤的bug
    t.增加接口說(shuō)明文檔    
5.2013.06.01
    a.版本提升為1.7.2.0
    b.gaudio_source_set_error_callback回調(diào)函數(shù)增加音源參數(shù)
    c.gaudio_source_set_finish_callback回調(diào)函數(shù)增加音源參數(shù)
    d.移除gaudio_get_version函數(shù)
    e.gaudio_effect_setcallback函數(shù)調(diào)整為gaudio_effect_set_callback
    f.使用插件式的音頻驅(qū)動(dòng)模式(gwinmm)以方便支持linux和mac
    g.gaudio代碼優(yōu)化
    h.增加音頻源碼率的獲取
    i.修改gfeature范例
    j.完善文檔

readmap
1.格式:對(duì)mp3的支持
2.音效:立體聲增強(qiáng)
3.處理故障/優(yōu)化代碼    

target
1.支持常見(jiàn)音頻格式
2.支持常見(jiàn)音效
3.支持3D播放模式
4.最大支持3-8個(gè)音源同時(shí)播放
5.支持音頻轉(zhuǎn)換
6.支持錄音
7.支持音頻美化
8.跨平臺(tái)   
posted @ 2013-06-02 12:41 ccsdu2009 閱讀(657) | 評(píng)論 (1)編輯 收藏
 
#ifndef STREAM_BUFFER_H
#define STREAM_BUFFER_H
#include 
<stdio.h>
#include 
<stdlib.h>
#include 
"gaudio.h"

typedef 
struct _streamBuffer streamBuffer;
//typedef size_t(*streamRead)(void* ctx,void* ptr,size_t size,size_t nmemb);
//typedef int(*streamSeek)(void* ctx,glong offset,int flag);
//typedef int(*streamClose)(void* ctx);

streamBuffer
* stream_open_file(const gchar* file);
streamBuffer
* stream_open_mem(gvoid* mem,gulong size);
streamBuffer
* stream_open_callbacks(gread read,gseek seek,gtell tell,gclose close,gvoid* context);
glong         stream_read(streamBuffer
* stream,gvoid* ptr,gint size,glong nmemb);
glong         stream_seek(streamBuffer
* stream,glong offset,gint flag);
glong         stream_close(streamBuffer
* stream);

#endif
//! by ccsdu2004

#include <stdio.h>
#include 
<string.h>
#include 
"streamBuffer.h"
#include 
"gmemory.h"

struct _streamBuffer
{
    gread  read;
    gseek  seek;
    gclose close;
    gtell  tell;
    
void*  ctx;
};

typedef 
struct _stdIOContext
{
    FILE 
*fp;
}stdIOContext;

glong stdio_stream_read(gvoid
* ptr,gint size,glong nmemb,gvoid* ctx)
{
    
return fread(ptr,size,nmemb,((stdIOContext*)ctx)->fp);
}

glong stdio_stream_seek(gvoid
* ctx,glong offset,gint flag)
{
    
return fseek(((stdIOContext*)ctx)->fp,offset,flag);
}

glong APIENTRY stdio_stream_tell(gvoid
* ctx)
{
    
return ftell(((stdIOContext*)ctx)->fp);
}

glong stdio_stream_close(gvoid
* ptr)
{
    stdIOContext
* ctx = (stdIOContext*)ptr;
    gint ret 
= 0;
    ret 
= fclose(ctx->fp);
    gFreeBuffer(ctx);
    
return ret;
}

typedef 
struct memContext
{
    guchar
* base;
    guchar
* current;
    guchar
* end;
}memContext;

glong mem_stream_read(gvoid
* ptr,gint size,glong nmemb,gvoid* ctx)
{
    streamBuffer
* stream = (streamBuffer*)ctx;
    memContext 
*c;
    glong count;

    c 
= (memContext*)stream;
    count 
= nmemb;

    
if(c->current + count * size > c->end)
        count 
= (c->end - c->current) / size;

    memcpy(ptr, c
->current, count * size);
    c
->current += count * size;
    
return count;
}

glong mem_stream_seek(gvoid
* ctx,glong offset,gint flag)
{
    streamBuffer
* stream = (streamBuffer*)ctx;
    memContext
* c;
    c 
= (memContext*)stream;
    
if(c == NULL)
        
return -1;
    
if(flag == SEEK_SET)
    {
        
if(offset < 0 || offset > c->end - c->base)
            
return -1;
        c
->current = c->base + offset;
        
return 0;
    }
    
else if(flag == SEEK_CUR)
    {
        
if(offset > 0)
        {
            
if(offset > c->end - c->current)
                
return -1;
            c
->current += offset;
            
return 0;
        }
        
else if(offset < 0)
        {
            
if(-offset > c->current - c->base)
                
return -1;
            c
->current += offset;
            
return 0;
        }
    }
    
else if(flag == SEEK_END)
    {
        
if(offset > 0 || offset > c->end - c->base)
            
return -1;
        c
->current = c->end - offset;
        
return 0;
    }
    
return -1;
}

glong mem_stream_close(gvoid 
*ptr)
{
    memContext
* ctx = (memContext*)ptr;
    gFreeBuffer(ctx
->base);
    gFreeBuffer(ctx);
    
return 0;
}

streamBuffer
* stream_open_fp(FILE* fp)
{
    stdIOContext
* ctx;
    streamBuffer
* stream;

    stream 
= gcreate_buffer<streamBuffer>(1);
    
if(stream == NULL)
        
return NULL;

    ctx 
= gcreate_buffer<stdIOContext>(1);
    
if(ctx == NULL)
    {
        gFreeBuffer(stream);
        
return NULL;
    }

    ctx
->fp = fp;
    stream
->ctx = ctx;
    stream
->read = stdio_stream_read;
    stream
->seek = stdio_stream_seek;
    stream
->close = stdio_stream_close;
    
return stream;
}

streamBuffer
* stream_open_file(const gchar *file)
{
    FILE 
*fp;
    fp 
= fopen((char*)file,"rb");
    
if(fp == NULL)
       
return NULL;
    
return stream_open_fp(fp);
}

streamBuffer
* stream_open_mem(gvoid* mem,gulong size)
{
    memContext
*   ctx;
    streamBuffer
* stream;

    stream 
= gcreate_buffer<streamBuffer>(1);
    
if(stream == NULL)
        
return NULL;

    ctx 
= gcreate_buffer<memContext>(1);
    
if(ctx == NULL)
    {
        gFreeBuffer(stream);
        
return NULL;
    }

    ctx
->base = (guchar*)mem;
    ctx
->current = (guchar*)mem;
    ctx
->end = ((guchar*) mem) + size;

    stream
->ctx = ctx;
    stream
->read = mem_stream_read;
    stream
->seek = mem_stream_seek;
    stream
->close = mem_stream_close;

    
return stream;
}

streamBuffer
* stream_open_callbacks(gread read,gseek seek,gtell tell,gclose close,gvoid* context)
{
    streamBuffer
* stream = gcreate_buffer<streamBuffer>(1);
    
if(stream == NULL)
       
return NULL;

    stream
->ctx = context;
    stream
->read = read;
    stream
->seek = seek;
    stream
->tell = tell;
    stream
->close = close;
    
return stream;
}

glong stream_read(streamBuffer
* stream,gvoid* ptr,gint size,glong nmemb)
{
    
return stream->read(ptr,size,nmemb,stream->ctx);
}

glong stream_seek(streamBuffer
* stream,glong offset,gint flag)
{
    
return stream->seek(stream,offset,flag);
    
/*size_t c;
    char tmp[1024];
    while(offset > 0)
    {
        c = offset;
        if(c > 1024)
           c = 1024;
        offset -= c;

        if(c != stream_read(stream,tmp,1,c))
        {
        }
    }
    return 1;
*/
}

glong stream_close(streamBuffer
* stream)
{
    gint ret 
= stream->close(stream->ctx);
    gFreeBuffer(stream);
    
return ret;
}
posted @ 2013-04-09 20:56 ccsdu2009 閱讀(656) | 評(píng)論 (0)編輯 收藏
 
     摘要: 這個(gè)也比較有用Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->#ifndef UI_TEST_H#define UI_TEST_H#include <QtCore/QVariant>#include ...  閱讀全文
posted @ 2013-02-23 15:42 ccsdu2009 閱讀(1130) | 評(píng)論 (0)編輯 收藏
 
#ifndef QTEST_H
#define QTEST_H
#include 
<QWidget>
#include 
<QState>
#include 
<QStateMachine>
#include 
"ui_test.h"

class QTest : public QWidget
{
    Q_OBJECT
public:
    QTest(QWidget 
*parent = 0, Qt::WFlags flags = 0);
    
~QTest();
private:
    UI ui;
    QStateMachine
* machine;
    QState
* state1;
    QState
* state2;
};

#endif
#include <QPropertyAnimation>
#include 
<QSignalTransition>
#include 
"qtest.h"
#include 
<iostream>

QTest::QTest(QWidget 
*parent, Qt::WFlags flags):QWidget(parent, flags)
{   
    machine 
= new QStateMachine(this);
    state1 
= new QState(machine); 
    state2 
= new QState(machine); 
    
    ui.setupUi(
this);

    QSize size(
300,280);
 
    
//state1->assignProperty(ui.groupBox,"size",size);
    state1->assignProperty(this,"size",QSize(313,224));
    
//state2->assignProperty(ui.groupBox,"size",QSize(size.width(),0));
    state2->assignProperty(this,"size",QSize(313,40));
    
//state2->assignProperty(ui.);
    
    
/*QPropertyAnimation* ani1 = new QPropertyAnimation(ui.groupBox,"size");  
    ani1->setDuration(800);    
    ani1->setEasingCurve(QEasingCurve::Linear); 
*/ 

    QPropertyAnimation
* ani2 = new QPropertyAnimation(this,"size");  
    ani2
->setDuration(1200);    
    ani2
->setEasingCurve(QEasingCurve::Linear); 
    
    QSignalTransition 
*transition1=state1->addTransition(ui.button,SIGNAL(clicked()),state2);
    
//transition1->addAnimation(ani1);  
    transition1->addAnimation(ani2);
    QSignalTransition 
*transition2=state2->addTransition(ui.button,SIGNAL(clicked()),state1);  
    
//transition2->addAnimation(ani1); 
    transition2->addAnimation(ani2);
    machine
->setInitialState(state1);
    machine
->start();      
}

QTest::
~QTest()
{
}

這個(gè)例子很實(shí)用
posted @ 2013-02-21 21:43 ccsdu2009 閱讀(822) | 評(píng)論 (0)編輯 收藏
 
很簡(jiǎn)單:
    QPrinter printer(QPrinter::HighResolution);
    printer.setOutputFormat(QPrinter::PdfFormat);
    QString name = ui.line->text();
    printer.setOutputFileName(pdf);
    ui.text->document()->print(&printer);
很簡(jiǎn)單 不過(guò)貌似沒(méi)有保存為doc文檔的接口
posted @ 2013-02-10 20:13 ccsdu2009 閱讀(889) | 評(píng)論 (0)編輯 收藏
 
To use the library to create WavPack files from raw PCM audio, the user must provide a WavpackBlockOutput function that is used by the library to write finished WavPack blocks to the output. Unlike the read case, there is no facility to write directly to named files. Here is the function required:

  typedef int (*WavpackBlockOutput)(void *id, void *data, int32_t bcount);

where the "id" is used to differentiate the regular WavPack data "wv" from the correction data "wvc" (or for the case of multiple streams running at the same time). The return value is simply TRUE for success and FALSE for error. An example of this function can be found in wavpack.c called write_block().

The basic procedure for creating WavPack files is this:

  1. get a context and set block output function with WavpackOpenFileOutput()
  2. set the data format and specify modes with WavpackSetConfiguration()
  3. optionally write a RIFF header with WavpackAddWrapper()
  4. allocate buffers and prepare for packing with WavpackPackInit()
  5. actually compress audio and write blocks with WavpackPackSamples()
  6. flush final samples into blocks with WavpackFlushSamples()
  7. optionally write MD5 sum with WavpackStoreMD5Sum()
  8. optionally write RIFF trailer with WavpackAddWrapper()
  9. if MD5 sum or RIFF trailer written, call WavpackFlushSamples() again
  10. optionally append metadata tag with functions in next section
  11. optionally update number of samples with WavpackUpdateNumSamples()
  12. close the context with WavpackCloseFile()

Note that this does not show opening and closing the output files which is done by the application itself.

  WavpackContext *WavpackOpenFileOutput (WavpackBlockOutput blockout,void *wv_id, void *wvc_id);
  -----------------------------------------------------------------

Open context for writing WavPack files. The returned context pointer is used in all following calls to the library. The "blockout" function will be used to store the actual completed WavPack blocks and will be called with the id pointers containing user defined data (one for the wv file and one for the wvc file). A return value of NULL indicates that memory could not be allocated for the context.

  int WavpackSetConfiguration (WavpackContext *wpc,WavpackConfig *config,uint32_t total_samples);
  ----------------------------------------------------

Set configuration for writing WavPack files. This must be done before sending any actual samples, however it is okay to send wrapper or other metadata before calling this. The "config" structure contains the following *required* information:

 config->bytes_per_sample     see WavpackGetBytesPerSample() for info
 config->bits_per_sample      see WavpackGetBitsPerSample() for info
 config->channel_mask         Microsoft standard (mono = 4, stereo = 3)
 config->num_channels         self evident
 config->sample_rate          self evident

Be particularly careful with the "channel_mask" field. If this is not set to the correct value (3 or 4) then everything will still appear to work
correctly, but the resulting WavPack file will have undefined channel assignments. When this file is unpacked back to WAV it will then get a
WAVEFORMATEXTENSIBLE header which some programs refuse to recognize.

Specifying these 5 parameters alone would create a default lossless WavPack file, identical to the one produced by using the command-line program without options. For optional configuration, the following fields and flags may be set:

 config->flags:
 --------------
 o CONFIG_HYBRID_FLAG         select hybrid mode (must set bitrate)
 o CONFIG_JOINT_STEREO        select joint stereo (must set override also)
 o CONFIG_JOINT_OVERRIDE      override default joint stereo selection
 o CONFIG_HYBRID_SHAPE        select hybrid noise shaping (set override & shaping_weight != 0.0)
 o CONFIG_SHAPE_OVERRIDE      override default hybrid noise shaping (set CONFIG_HYBRID_SHAPE and shaping_weight)
 o CONFIG_DYNAMIC_SHAPING     force dynamic noise shaping even when WavPack
                               would not use it (no need to set any of the
                               other shaping flags when using this one)
 o CONFIG_FAST_FLAG           "fast" compression mode (same as -f)
 o CONFIG_HIGH_FLAG           "high" compression mode (same as -h)
 o CONFIG_VERY_HIGH_FLAG      "very high" compression mode (same as -hh)
 o CONFIG_BITRATE_KBPS        hybrid bitrate is kbps, not bits / sample
 o CONFIG_CREATE_WVC          create correction file
 o CONFIG_OPTIMIZE_WVC        maximize bybrid compression (same as -cc)
 o CONFIG_CALC_NOISE          calc noise in hybrid mode
 o CONFIG_EXTRA_MODE          extra processing mode (same as -x)
 o CONFIG_SKIP_WVX            no wvx stream for floats & large ints (same as -p)
 o CONFIG_MD5_CHECKSUM        specify if you plan to store MD5 signature (the sum is calculated by the application, NOT by the library)
 o CONFIG_CREATE_EXE          specify if you plan to prepend sfx module
 o CONFIG_OPTIMIZE_MONO       detect and optimize for mono files posing as
                               stereo (uses a more recent stream format that
                               is not compatible with decoders < 4.3)

 config->bitrate              hybrid bitrate in either bits/sample or kbps
 config->shaping_weight       hybrid noise shaping coefficient override
 config->block_samples        force samples per WavPack block (0 = use default, else 1-131072)
 config->float_norm_exp       select floating-point data (127 for +/-1.0)
 config->xmode                extra mode processing value override (1-6)

If the number of samples to be written is known then it should be passed here.
If the duration is not known then pass -1. In the case that the size is not
known (or the writing is terminated early) then it is suggested that the
application retrieve the first block written and let the library update the
total samples indication. A function is provided to do this update and it
should be done to the "correction" file also. If this cannot be done (because
a pipe is being used, for instance) then a valid WavPack will still be created
(assuming the initial duration was set to -1), but when applications want to
access that file they will have to seek all the way to the end to determine the
actual duration (the library takes care of this). Also, if a RIFF header has
been included then it should be updated as well or the WavPack file will not be
directly unpackable to a valid wav file (although it will still be usable by
itself). A return of FALSE indicates an error (use WavpackGetErrorMessage() to
find out what happened).

  int WavpackPackInit (WavpackContext *wpc);
  -----------------------------------------

Prepare to actually pack samples by determining the size of the WavPack blocks
and allocating sample buffers and initializing each stream. Call after
WavpackSetConfiguration() and before WavpackPackSamples(). A return of FALSE
indicates an error.

  int WavpackPackSamples (WavpackContext *wpc,
                          int32_t *sample_buffer,
                          uint32_t sample_count);
  ----------------------------------------------

Pack the specified samples. Samples must be stored in 32-bit longs in the
native endian format of the executing processor. The number of samples specified
indicates composite samples (sometimes called "frames"). So, the actual number
of data points would be this "sample_count" times the number of channels. Note
that samples are accumulated here until enough exist to create a complete
WavPack block (or several blocks for multichannel audio). If an application
wants to break a block at a specific sample, then it just calls
WavpackFlushSamples() to force an early termination. Completed WavPack blocks
are sent to the function provided in the initial call to
WavpackOpenFileOutput(). A return of FALSE indicates an error (which most likely
indicates the that user-supplied blockout function returned an error).

  int WavpackFlushSamples (WavpackContext *wpc);
  ---------------------------------------------

Flush all accumulated samples into WavPack blocks. This is normally called after
all samples have been sent to WavpackPackSamples(), but can also be called to
terminate a WavPack block at a specific sample (in other words it is possible
to continue after this operation). This also must be called to dump non-audio
blocks like those holding metadata for MD5 sums or RIFF trailers. A return of
FALSE indicates an error.

  void WavpackUpdateNumSamples (WavpackContext *wpc, void *first_block);
  ---------------------------------------------------------------------

Given the pointer to the first block written (to either a .wv or .wvc file),
update the block with the actual number of samples written. If the wav header
was generated by the library, then it is updated also. This should be done if
WavpackSetConfiguration() was called with an incorrect number of samples (or
-1). This should also be done in the case where the application did not provide
the RIFF header but did add some chunks for a RIFF trailer (see the section
on adding RIFF metadata). It is the responsibility of the application to read
and rewrite the block. An example of this can be found in the Audition filter
or in the command-line packer when the -i option is used. ON MACHINES WITH
ALIGNMENT REQUIREMENTS, BE SURE THAT THE PASSED POINTER IS PROPERLY ALIGNED!

  int WavpackStoreMD5Sum (WavpackContext *wpc, uchar data [16]);
  -------------------------------------------------------------

Store computed MD5 sum in WavPack metadata. Note that the user must compute the
16 byte sum; it is not done here. It is also required that WavpackFlushSamples()
be called after this to make sure the block containing the MD5 sum is actually
written. A return of FALSE indicates an error.

  WavpackContext *WavpackCloseFile (WavpackContext *wpc);
  ------------------------------------------------------

Close the specified WavPack file and release all resources used by it.
Returns NULL.


With respect to the RIFF WAV wrapper that is inormally appended to the WavPack
file, there are three options available for the application to handle this.

The first is the simplest, and that is for the application to simply do
nothing. The library will automatically create a RIFF header appropriate for
the audio data (including WAVEFORMATEXTENSIBLE if needed) and store this
in the WavPack file. If the application does not know the actual number of
samples beforehand and needs to reread the first block and have the library
update it, then the library will handle updating its own RIFF header also.
In this scenario, there will be no trailing RIFF data. For the vast majority
of applications, this will be all that is required.

However, some applications may want to store a custom RIFF header (and trailer)
so that they can store extra RIFF chunks in there or perhaps they want to
create an exact copy of a .wav file (like the WavPack command-line program
does). To accomplish this, functions are provided (see below) to add RIFF
metadata to a WavPack file being written. In this case, the application must
provide a verbatim copy of all the RIFF data from the initial "RIFF" at the
beginning of the file up to (and including) the size field of the "data"
chunk. If any trailing RIFF data is desired, then this is appended after all
samples have been packed and flushed. This wrapper data will be *exactly*
what wvunpack will use to restore an original WAV file. In no circumstances
does the WavPack library parse, verify, or otherwise use this data.

If the RIFF header information needs to be updated after packing (because the
total file size or the data chunk size need to be update) then the first
block must be reread and the function WavpackGetWrapperLocation() must be
called to find the wrapper in the block (it would be possible to find it by
searching for the "RIFF", but using this function is significantly less ugly).
The WavPack library will not touch a wrapper that it did not create when
calling WavpackUpdateNumSamples().

The third option for including RIFF data chunks is a hybrid between these
two methods and is useful if an application wants to add a few specific RIFF
chunks and does not mind if the chunks appear at the end of the WAV file. In
this method, the application does not send any RIFF header before packing the
audio data which forces the library to create and store a standard RIFF header.
However, when all samples have been packed, the application sends the RIFF
chunks that it wants to add at the end of the file (RIFF trailer). Then, after
flushing, it must reread the first block and call WavpackUpdateNumSamples() so
that the library can update the RIFF header to reflect the added chunks (even
if the number of samples was correct). Because the library created the header,
it will update it, and will take into account the RIFF chunks added to the end.

All of this wrapper stuff can be a little confusing. It is a good idea to
test that the final application is working correctly and creating WavPack
files that will unpack to valid WAV files (even if the RIFF info is totally
wrong, the files will still work perfectly well as WavPack files because,
again, the RIFF wrapper is just informational). The first test is to use the
-ss option on WvUnpack to make sure the RIFF wrapper is reported correctly.
Then, unpack the WavPack file into a WAV using WvUnpack and repack it again
with the standard WavPack command-line program (without options). If it
doesn't complain about anything then there is a good chance that all the
wrapper information is valid.

Here are the appropriate functions:

  int WavpackAddWrapper (WavpackContext *wpc, void *data, uint32_t bcount);
  ------------------------------------------------------------------------

Add wrapper (currently RIFF only) to WavPack blocks. This should be called
before sending any audio samples in the case of the RIFF header or after all
samples have been sent (and flushed) for any RIFF trailer. It is also
required that WavpackFlushSamples() be called again after specifying a RIFF
trailer to make sure it is actually written to the file.

If the exact contents of the RIFF header are not known because, for example,
the file duration is uncertain or trailing chunks are possible, simply write
a "dummy" header of the correct length. When all data has been written it
will be possible to read the first block written and update the header
directly. An example of this can be found in the Audition filter. A return of
FALSE indicates an error.

  void *WavpackGetWrapperLocation (void *first_block, uint32_t *size);
  -------------------------------------------------------------------

Given the pointer to the first block written to a WavPack file, this function
returns the location of the stored RIFF header that was originally written with
WavpackAddWrapper(). This would normally be used to update the wav header to
indicate that a different number of samples was actually written or if
additional RIFF chunks are written at the end of the file. The "size" parameter
can be set to non-NULL to obtain the exact size of the RIFF header, and the
function will return FALSE if the header is not found in the block's metadata
(or it is not a valid WavPack block). Note that the size of the RIFF header
cannot be changed and it is the responsibility of the application to read and
rewrite the block. An example of this can be found in the Audition filter.


******************************************************************************
*************************   5.0 TAGGING FUNCTIONS   **************************
******************************************************************************

The WavPack library contains rudimentary support to read and write metadata tags
on WavPack files. This includes creating new APEv2 tags during WavPack file
creation, reading text fields from both ID3v1 and APEv2 tags on existing
WavPack files, and editing data in APEv2 tags.

Users should be aware of the following limitations of this functionality:

1. ID3v1 tags are read-only, and cannot be accessed if there is an APEv2 tag
   prior to them in the file. ID3v1 tags are lost if the prior APEv2 tag is
   edited.

2. The text items in APEv2 tags are UTF-8 encoded. The functionality of
   converting to/from any local or multi-byte encoding must be handled by the
   calling application.

3. The binary items of APEv2 tags can now (version 4.60+) be read and written.
   To implement this in a backward-compatible way, the existing functions for
   accessing text tag items were simply duplicated as versions handling only
   binary tags items. The versions for text tag items work exactly as before
   (ignoring binary items) and the binary versions ignore text items.

   The convention for binary tag items in APEv2 tags is that the data starts
   with a NULL-terminated string representing a filename. After the terminating
   NULL, the actual binary data starts. In the WavPack code this filename has
   only the extension of the actual file; the name portion is made up of the
   tag item name. NOTE THAT THIS FUNCTIONALITY IS NOT HANDLED IN THE LIBRARY.
   THE LIBRARY ONLY STORES AND RETRIEVES A BINARY IMAGE AND IT IS UP TO THE
   CALLING APPLICATION TO APPEND AND HANDLE THIS FILENAME.

4. When APEv2 tags are edited and the resulting tags are shorter than the
   original tags, the tag is padded with zeros at the front rather than having
   the file shortened, and this padding cannot be reclaimed by future editing.
   The net result of this is that repeated editing of tags will cause the file
   to grow indefinitely (although this will only happen when the tag is
   actually made smaller).

In these descriptions the meaning of the word "tag" refers to the whole bundle
that is appended to the end of the WavPack file. This bundle may contain many
individual items, each consisting of a key/value pair. The key is referred to
here as the "item", meaning the item's name (like "artist"). Some people refer
to the individual items as "tags", but that usage is not used here. Also note
that APEv2 tags store the case of tag item names and values, but are not case
sensitive when locating tag item names (and this is carried here into the
lookup of ID3v1 tag item names).


  int WavpackGetNumTagItems (WavpackContext *wpc);
  int WavpackGetNumBinaryTagItems (WavpackContext *wpc);
  ------------------------------------------------------

Count and return the total number of tag items (either text or binary) in the
specified file. This works with either ID3v1 tags or APEv2 tags (although ID3V1
tags do not have binary items).

  int WavpackGetTagItem (WavpackContext *wpc,
                         const char *item,
                         char *value,
                         int size);

  int WavpackGetBinaryTagItem (WavpackContext *wpc,
                               const char *item,
                               char *value,
                               int size)
  ------------------------------------------------------------

Attempt to get the specified item from the specified file's ID3v1 or APEv2 tag.
The "size" parameter specifies the amount of space available at "value", if the
desired text item will not fit in this space then ellipses (...) will be
appended and the string terminated (binary tag data is simply truncated). The
actual length of the string (or binary data) is returned (or 0 if no matching
value found). Note that with APEv2 text tags the length might not be the same
as the number of characters because UTF-8 encoding is used. Also, APEv2 text
tags can have multiple (NULL separated) strings for a single value (this is why
the length is returned). If this function is called with a NULL "value" pointer
(or a zero "length") then only the actual length of the value data is returned
(not counting the terminating NULL of text tag items). This can be used to
determine the actual memory to be allocated beforehand.

For ID3v1 tags the only "item" names supported are "title", "artist", "album",
"year", "comment" and "track" (which is converted to numeric text by the
library).

  int WavpackGetTagItemIndexed (WavpackContext *wpc,
                                int index,
                                char *item,
                                int size);

  int WavpackGetBinaryTagItemIndexed (WavpackContext *wpc,
                                      int index,
                                      char *item,
                                      int size);
  -------------------------------------------------

This function looks up the tag item name by index and is used when the
application wants to access all the items in the file's ID3v1 or APEv2 tag.
Note that this function accesses only the item's name; WavpackGetTagItem()
still must be called to get the actual value. The "size" parameter specifies
the amount of space available at "item", if the desired item will not fit in
this space then ellipses (...) will be appended and the string terminated.
The actual length of the string is returned (or 0 if no item exists for index).
If this function is called with a NULL "value" pointer (or a zero "length")
then only the actual length of the item name is returned (not counting the
terminating NULL). This can be used to determine the actual memory to be
allocated beforehand.

  int WavpackAppendTagItem (WavpackContext *wpc,
                            const char *item,
                            const char *value,
                            int vsize);

  int WavpackAppendBinaryTagItem (WavpackContext *wpc,
                                  const char *item,
                                  const char *value,
                                  int vsize);
  ---------------------------------------------

This function is used to append (or replace) the specified field to the tag
being created or edited. If no tag has been started, then an empty one will be
allocated first. When finished adding all the items to the tag, use
WavpackWriteTag() to write the completed tag to the file. Note that ID3 tags
are not supported. A size parameter is included so that text values containing
multiple (NULL separated) strings (and binary data) can be written. A FALSE
return indicates an error.

  int WavpackDeleteTagItem (WavpackContext *wpc, const char *item);
  ----------------------------------------------------------------

Delete the specified tag item from the APEv2 tag being created or edited. This
function works with either text or binary fields. Returns TRUE to indicate that
an item was actually deleted from the tag.

  int WavpackWriteTag (WavpackContext *wpc);
  -----------------------------------------

Once a APEv2 tag has been created (or edited) using WavpackAppendTagItem()
(and WavpackDeleteTagItem()), this function is used to write the completed tag
to the end of the WavPack file. Note that this is NOT done for EACH item in the
tag, but only after ALL items have been added to the tag.

If this function is called when creating a WavPack file, then it uses the same
"blockout" function that is used to write regular WavPack blocks (and should be
called after flushing all the audio data and writing any WavPack metadata like
RIFF trailers and MD5 sums). It may call the blockout function multiple times
to write the tag.

If this function is called when editing an existing APEv2 tag, then it will
seek to the correct position and write the tag using the WavpackStreamReader
function that has been added for this purpose (write_bytes) or using its
own standard I/O functions (if the WavpackStreamReader is not being used).
Because there is not currently a method implemented to truncate an existing
file to a shorter length, this function will pad the file with 0's in front
of a tag that had been edited to a shorter length.


******************************************************************************
**********************   6.0 HANDLING WAVPACK STREAMS   **********************
******************************************************************************

In some applications (for example streaming applications and some filters, or
cases where WavPack data might be embedded into another multimedia container)
it is required for the audio file parsing functions to be separated from the
decoding functions. This is accomplished in two steps with the WavPack library.

First, the parsing functions are implemented outside the WavPack library. It is
very straightforward to parse WavPack files because the WavPack block header is
easy to recognize, and contains easy to parse and interpret information about
the block's contents and its relation to the whole WavPack file (or stream). The
exact file and block formats are described in detail in the file_format.txt
document. The wputils.c module also contains helper functions and a useful
seeking function that may also be useful in creating a WavPack parser.

Next, the individual parsed blocks are decoded to PCM audio by the library. To
accomplish this a "file" is opened with WavpackOpenFileInputEx() where the
specified WavpackStreamReader is a function that will feed the raw WavPack
block's bytes into the library when requested. The flags parameter should have
the OPEN_STREAMING bit set so that the decoder will ignore the position and any
other "whole file" information in the block headers. The decoder will suck up
the first block (through the stream reader) that actually contains audio and
stop, ready to decode. The next step is to call WavpackUnpackSamples() to
unpack the actual number of samples in the block (which should be known by the
parser).

Normally, the entire block would be unpacked and then the decoder would be
ready for the next block. If a single additional sample is requested past the
size of the current block the decoder will attempt to read the next block, so
it is important to request the exact number of samples (unless this behavior is
okay). If it is not desired to finish decoding the block then there are two
options. The easiest would be to simply decode the rest of the block anyway and
discard the results. Another option would be to close the context with the
function WavpackCloseFile() and then open another context when needed.

This procedure will also work fine for multichannel WavPack files. The decoder
will have to suck up all the blocks for the various channels before decoding may
begin.


******************************************************************************
**************************   7.0 ZIP FORMAT USAGE   **************************
******************************************************************************

With version 11.0, WinZip Computing has added WavPack Audio to the official ZIP
file format standard as compression method 97, as described here:

    http://www.winzip.com/ppmd_info.htm

The WavPack library can easily be used to create or decode the WavPack images
stored in the ZIP files. Some issues to keep in mind:

1. Only lossless mode is used. WinZip's implementation uses the "very high"
   mode with no extra processing, although there is no reason that a different
   profile could not be employed as they would still be fully compatible (for
   example, the new "high" mode and/or the new "extra" mode could be used).

2. All bitdepths (including 32-bit floating-point) are supported. However,
   bitdepths that are not multiples of 8 should be rounded up to the next
   multiple of 8 to ensure that all samples (even illegal ones) are encoded
   losslessly (this is described in more detail in the WinZip document).

3. Multichannel data (with or without WAVEFORMATEXTENSIBLE) is fully supported.

4. CONFIG_OPTIMIZE_MONO is not available during decoding and therefore should
   not be used for encoding.

5. The WavPack data must have RIFF headers (to generate .wav files) and may
   optionally have RIFF trailers. It would not be appropriate to have WavPack
   generate the RIFF headers (either during encode or decode) because of the
   obvious danger of generating files that don't match exactly.

6. The WavPack data should probably NOT have metadata tags or MD5 sums added
   to it. This information would be discarded during decoding anyway and could
   possibly trigger an error condition in a decoder.

The easiest way of using the WavPack library to decode the embedded WavPack
data would be to open a WavPack context using WavpackOpenFileInputEx() and
provide a WavpackStreamReader that would read the appropriate part of the
ZIP file by using an offset. If only the standard unpacking operations are
used, then the WavPack library will not attempt to seek during a decode. The
only flag to use for the "open" call would be OPEN_WRAPPER.

The most critical aspect of creating WavPack images to embed in ZIP files is
making sure that the decoded data will exactly match the source. This is in
contrast to the case of WavPack command-line programs where some invalid WAV
files may not encode (or exactly decode) for one reason or another. For this
reason it is important to check the parameters in the WAV header carefully and
allow only a well-defined set of known good combinations. The size of the audio
data should be checked to make sure it contains the correct number of whole
composite samples (or if it doesn't then this is properly handled). Since
WavPack cannot properly decode WavPack files that contain no audio data (i.e.
zero samples), this case should also be avoided. In all situations where some
question exists, the prudent choice would be to default to some other (more
genereralized) data compression method.
posted @ 2013-02-09 18:57 ccsdu2009 閱讀(972) | 評(píng)論 (0)編輯 收藏
僅列出標(biāo)題
共38頁(yè): First 9 10 11 12 13 14 15 16 17 Last 
 
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            性色av一区二区三区| 亚洲国产精品99久久久久久久久| 亚洲精品一区二| 欧美激情综合| 欧美高清视频在线观看| 日韩写真视频在线观看| 一区二区欧美在线观看| 国产美女精品人人做人人爽| 久久精品国产视频| 久久在线91| 中文日韩在线| 羞羞色国产精品| 伊人成人在线| 亚洲精品色图| 国产一区二区精品久久| 欧美大片第1页| 欧美日韩影院| 久久野战av| 免费一区视频| 欧美一区二区三区婷婷月色| 久久日韩粉嫩一区二区三区| 一区二区三区毛片| 欧美在线91| 99成人在线| 久久成人免费日本黄色| 日韩一区二区精品| 欧美中文字幕在线| 中文久久精品| 久久综合给合久久狠狠色| 亚洲午夜久久久| 久久久国产成人精品| 亚洲性色视频| 欧美xx视频| 久久久999精品免费| 欧美日韩三级电影在线| 欧美xx视频| 国产免费观看久久黄| 亚洲激情精品| 狠狠色丁香久久综合频道| 妖精视频成人观看www| 亚洲国产成人porn| 欧美一区午夜精品| 亚洲女人av| 欧美日本在线看| 欧美阿v一级看视频| 国产亚洲电影| 一区二区三区色| 99re热这里只有精品免费视频| 久久久久久网| 久久免费黄色| 国产日韩欧美亚洲| 亚洲欧美另类中文字幕| 亚洲男人第一网站| 国产精品福利片| 亚洲最新视频在线| 亚洲视屏在线播放| 欧美日韩另类综合| 亚洲精品字幕| 一本色道88久久加勒比精品| 裸体一区二区| 欧美国产日韩免费| 亚洲人www| 免费视频最近日韩| 亚洲国产精品va在线看黑人动漫| 一区二区在线观看视频在线观看| 欧美资源在线观看| 美脚丝袜一区二区三区在线观看| 国模精品一区二区三区| 久久久精品五月天| 欧美电影免费观看高清| 91久久精品久久国产性色也91| 麻豆精品视频在线| 亚洲欧洲一区二区三区久久| 99re在线精品| 国产精品卡一卡二卡三| 亚洲欧美在线播放| 麻豆精品在线视频| 亚洲精品视频一区| 国产精品va| 久久高清国产| 亚洲激情精品| 香港久久久电影| 国产亚洲精品久久飘花| 久久亚洲私人国产精品va| 欧美激情自拍| 亚洲午夜成aⅴ人片| 欧美国产精品劲爆| 一本色道久久综合亚洲精品不卡| 中文av一区特黄| 国产精品自拍视频| 欧美一区中文字幕| 久久国产日本精品| 91久久国产自产拍夜夜嗨| 欧美区一区二区三区| 在线亚洲伦理| 久久精品国产77777蜜臀| 激情av一区二区| 久久免费黄色| 亚洲天堂av图片| 久久国产精品网站| 亚洲国产精品一区二区第一页| 欧美黑人一区二区三区| 亚洲视频www| 免费不卡亚洲欧美| 亚洲欧美日韩中文视频| 国模 一区 二区 三区| 欧美肥婆bbw| 亚洲视频一区二区免费在线观看| 亚洲欧美一级二级三级| 亚洲观看高清完整版在线观看| 性欧美在线看片a免费观看| 一区二区三区高清在线观看| 亚洲午夜激情在线| 一本色道久久综合狠狠躁篇的优点| 欧美影院一区| 国产日韩欧美在线一区| 新片速递亚洲合集欧美合集 | 一本色道精品久久一区二区三区| 亚洲欧美日韩国产中文在线| 国产视频一区免费看| 久久尤物视频| 亚洲美女在线视频| 久久免费视频在线| 日韩亚洲精品在线| 尤物九九久久国产精品的特点| 欧美日韩午夜在线| 久久久精品国产99久久精品芒果| 亚洲青色在线| 久久精品人人做人人爽| 在线观看不卡av| 国产亚洲网站| 国产精品久久久久久av下载红粉 | 亚洲网站在线观看| 欧美黄色视屏| 欧美在线观看一二区| 亚洲免费大片| 一区在线观看视频| 国产欧美日韩一级| 欧美午夜免费电影| 欧美日韩和欧美的一区二区| 久久精品国产一区二区三| 亚洲欧美99| 一本一本久久| 亚洲美女黄网| 亚洲第一视频| 久久综合久久综合九色| 欧美一区二区三区在线观看视频| 一区二区三区毛片| 日韩视频免费观看| 日韩一区二区高清| 亚洲免费播放| 999亚洲国产精| 中日韩午夜理伦电影免费| 亚洲麻豆国产自偷在线| 91久久精品日日躁夜夜躁国产| 亚洲电影免费观看高清完整版在线观看 | 亚洲午夜免费福利视频| 亚洲精品欧美极品| 免费在线国产精品| 久久久激情视频| 久久综合久久美利坚合众国| 久久综合久色欧美综合狠狠 | 激情久久久久久| 伊人影院久久| 亚洲黄色在线观看| av不卡在线| 99精品欧美一区二区三区| 在线视频欧美日韩精品| 亚洲在线免费视频| 欧美在线视频在线播放完整版免费观看 | 久久综合亚洲社区| 免费一级欧美片在线播放| 农村妇女精品| 欧美日韩一区二区视频在线观看| 欧美日韩在线一区二区三区| 国产精品久久亚洲7777| 国产一区二区按摩在线观看| 亚洲国产精品99久久久久久久久| 亚洲肉体裸体xxxx137| 99视频+国产日韩欧美| 亚洲欧美偷拍卡通变态| 久久久精彩视频| 最新成人在线| 香港久久久电影| 免费不卡中文字幕视频| 欧美日韩中文字幕在线视频| 国产亚洲午夜| 99国内精品| 亚洲午夜电影在线观看| 免费成人你懂的| 在线一区亚洲| 久久蜜臀精品av| 欧美视频在线免费看| 国产精品一国产精品k频道56| 亚洲人成人一区二区在线观看| 亚洲免费一在线| 亚洲黄色在线看| 久久av老司机精品网站导航| 欧美激情免费观看| 欧美激情偷拍|