Cpper
C/C++高级工程师 Android高级软件工程师 IT集成工程师 音频工程师 熟悉c,c++,java,c#,py,js,asp等多种语言 程序猿

置顶随笔

gaudio是一个基于C/C++混合编程的跨平台音频库,当前支持windows32操作系统和linux32位操作系统

修改记录
1.2013.04.01
    初次发布
2.2013.04.10
    完成对wav格式采样频率8000-48000,采样格式4,8,16,24,32的支持     
3.2013.05.01
    a.版本提升为1.4.0.8
    b.修改一个退出异常
    c.支持二源混音
    d.使用载入插件的方式提供对wav播放的支持
    e.增加对au格式的支持
    f.增加echo音效
    g.增加bassboost音效
    h.增加函数gaudio_address_get
    i.增加使用例子:echo/mixer/stream/boost
    j.把设置,获取音源三维空间信息的函数调整为: gaudio_source_set_float3,gaudio_source_get_float3
    k.修改解码器结构为回调模式
4.2013.05.10
    a.版本提升为1.6.8.0
    b.优化部分代码
    c.增加speedchanger音效
    d.增加音频翻转(g168)
    e.增加音频声道交换(g168)
    f.增加声道合并(g168)
    g.增加speedchanger/invert测试用例
    h.增加vc调用静态链接库libgaudio.lib
    i.增加调制音效和测试例子
    j.修改解码器框架
    k.修改获取音频采样编码格式不正确的问题
    l.解决seek定位不准的问题
    m.增加音效链测试例子
    n.增加函数gaudio_set_long,gaudio_get_long
    o.修改stream例子
    p.支持压缩mpc音频格式
    q.支持ogg/vorbis格式
    r.修改获取采样格式错误的bug
    t.增加接口说明文档    
5.2013.06.10
    a.版本提升为1.7.2.0
    b.gaudio_source_set_error_callback回调函数增加音源参数
    c.gaudio_source_set_finish_callback回调函数增加音源参数
    d.移除gaudio_get_version函数
    e.gaudio_effect_setcallback函数调整为gaudio_effect_set_callback
    f.使用插件式的音频驱动模式 - gwinmm
    g.gaudio代码优化
    h.增加音频源码率的获取
    i.增加feature范例
    j.完善文档
    k.增加对mp3的支持
    l.移除invert/modulator/bassboost例子
    m.增加balance
6.2013.07.07
    a.版本提升到1.8.0.2
    b.增加对交换文件aiff的支持
    c.修改音频驱动插件实现
    d.增加移相器音效
    e.修改部分API接口使用的long为int32_t以方便移植
    f.增加code::blocks测试工程
    g.增加msvc2008测试工程
    h.增加函数接口gaudio_source_create_from_buffer2以播放raw音频数据
    i.把各个音效参数提到单独文件
    j.简化wav解码
    k.修改几处内存泄漏
    l.增加音频回录功能,输出格式MP2,MP3,APE,WV,AAC,WAV,AU,AIFF,VOC,CAF,OGG
    当前录制信息:16位音频,双声道,采样频率44100
    m.增加音频回录的例子recorder
    n.测试例子使用getopt和usage提示
    o.增加对tta格式的支持    
7.2013.07.28
    a.版本提升到1.9.8.6                   
    b.解决了wav,au,aiff播放进度不准的故障
    c.优化wav/au/aiff解码性能        
    d.增加distortion音效              
    e.增加foldback distortion音效       
    f.增加distortion音效使用例子       
    g.增加声音穿透力                      
    h.修改结构最大支持八声道             
    i.增加portaudio插件驱动(win32&linux)  
    j.完成g168,bassbost的liux版本     
    k.完成wav,au音频格式的linux版本      
    l.代码增加部分注释(未完成)            
    m.尝试性支持linux操作系统             
    n.支持midi/mid音乐格式             
    o.解决了mixer混音退出报错的问题
    p.skip id3v2    
8.2013.08.16
    a.版本提升到2.0.0.1                    
    b.变量宏增加AUDIO_ENUM前缀
    c.增加非标准插件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宏和相关    
    c.引入200号插件支持s3m/mod/it/xm音频格式
    d.整理测试用例
    e.增加autowah音效
    f.增加驱动检测
10.2015.12.10 版本2.2.1.0
支持常见音频格式和音效,使用超级方便
下载在这里:/Files/gaimor/gaudio-sdk-2.2.1.0.zip

    
 
posted @ 2013-07-11 22:49 ccsdu2009 阅读(5290) | 评论 (2)编辑 收藏

2019年9月19日

import QtQuick 2.11

Rectangle 
{
    width
: 640
    height: 480
    color: "#0ff90f"

    Flipable {
            id: flip
            width: 300
            height: 300
            anchors.centerIn: parent

            property bool flipped: false

            front: Image{
                anchors.fill: parent
                source: "file:///C:/Users/Administrator/Desktop/11111/2099720.png"

                transform: Rotation{
                    origin.x: flip.width / 2
                    origin.y: flip.height / 2
                    axis.x: 0
                    axis.y: 1
                    axis.z: 0
                    angle: 180
                
}
            }

            back: Image
{
                anchors.fill
: parent
                source: "file:///C:/Users/Administrator/Desktop/11111/2099720.png"
            
}

            transform: Rotation
{
                id
: rotation
                origin.x: flip.width / 2
                origin.y: flip.height / 2
                axis.x: 0
                axis.y: 1
                axis.z: 0
                angle: 0
            
}

            states:State
{
                PropertyChanges {
                    target
: rotation
                    angle: 180
                
}
                when:flip.flipped
            }

            transitions: Transition
{
                NumberAnimation{
                    target
:rotation
                    properties: "angle"
                    duration: 240
                
}
            }

            MouseArea 
{
                anchors.fill
: parent
                onClicked:  flip.flipped = !flip.flipped
            
}
        }
}
posted @ 2019-09-19 18:22 ccsdu2009 阅读(15) | 评论 (0)编辑 收藏
 
import QtQuick 2.11

Rectangle 
{
    width
: 640
    height: 480
    color: "#0909ff"

    Flipable {
            id: flip
            width: 300
            height: 300
            anchors.centerIn: parent

            property bool flipped: false

            front:Image{
                anchors.fill: parent
                source: "file:///C:/Users/Administrator/Desktop/11111/2099720.png"
            
}

            back:Image
{
                anchors.fill
: parent
                source: "file:///C:/Users/Administrator/Desktop/11111/2099720-flip.png"
            
}

            transform: Rotation
{
                id
: rotation
                origin.x: flip.width / 2
                origin.y: flip.height / 2
                axis.x: 0
                axis.y: 1
                axis.z: 0
                angle: 0
            
}

            states:State
{
                PropertyChanges {
                    target
: rotation
                    angle: 180
                
}
                when:flip.flipped
            }

            transitions: Transition
{
                NumberAnimation{
                    target
:rotation
                    properties: "angle"
                    duration: 240
                
}
            }

            MouseArea 
{
                anchors.fill
: parent

                onClicked:  flip.flipped = !flip.flipped

            
}
        }
}
posted @ 2019-09-19 17:33 ccsdu2009 阅读(11) | 评论 (0)编辑 收藏
 
    int result = av_seek_frame(ffmpeg->formatCtx, -1,
        (ffmpeg->formatCtx->start_time + time) * AV_TIME_BASE,
        AVSEEK_FLAG_BACKWARD);
time单位为秒
posted @ 2019-09-19 09:51 ccsdu2009 阅读(10) | 评论 (0)编辑 收藏

2019年9月18日

import QtQuick 2.5
import QtQuick.Layouts 1.3
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4

Rectangle 
{
    width
: 640
    height: 480
    color: "#333333"

    Button {
        id: button
        text: "Button"
        anchors.horizontalCenter: parent.horizontalCenter
        anchors.top: parent.top
        anchors.topMargin: 6

        onClicked: {
            var count = layout.count
            if(layout.currentIndex == count - 1)
                layout.currentIndex = 0
            else
                layout.currentIndex ++
        
}
    }

    StackLayout 
{
        id
: layout
        anchors.top: button.bottom
        anchors.topMargin: 6
        anchors.horizontalCenter: parent.horizontalCenter
        width: 480
        height: 320
        currentIndex: 1
        Rectangle {
            color: 'teal'
            implicitWidth: 200
            implicitHeight: 200
        
}
        Rectangle 
{
            color
: 'plum'
            implicitWidth: 300
            implicitHeight: 200
        
}
        Rectangle 
{
            color
: '#c90909'
            implicitWidth: 300
            implicitHeight: 200
        
}
        Rectangle 
{
            color
: 'green'
            implicitWidth: 300
            implicitHeight: 200
        
}
        Rectangle 
{
            color
: 'grey'
            implicitWidth: 300
            implicitHeight: 200
        
}
    }
}
posted @ 2019-09-18 11:49 ccsdu2009 阅读(10) | 评论 (0)编辑 收藏
 
import QtQuick 2.5
import QtQuick.Layouts 1.2
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4

Rectangle 
{
    id
: circularProgressBar
    width: 60
    height: 60

    color: "#333333"
    property real currentValue: 86
    property bool textVisible: true
    property bool canClick: false

    Canvas {
        id: canvas
        anchors.fill: parent
        antialiasing: true

        property color primaryColor: "transparent"
        property color secondaryColor: "lightblue"

        property real centerWidth: width / 2
        property real centerHeight: height / 2
        property real radius: Math.min(canvas.width-10, canvas.height-10) / 2

        property real minimumValue: 0
        property real maximumValue: 100
        property alias currentValue : circularProgressBar.currentValue

        property string text: "0"
        property real angle: (currentValue - minimumValue) / (maximumValue - minimumValue) * 2 * Math.PI
        property real angleOffset: -Math.PI / 2

        property real rotate: 0.0

        onPrimaryColorChanged: requestPaint()
        onSecondaryColorChanged: requestPaint()
        onMinimumValueChanged: requestPaint()
        onMaximumValueChanged: requestPaint()
        onCurrentValueChanged: requestPaint()
        onRotateChanged: requestPaint()

        onPaint: {
            var ctx = getContext("2d")
;
            ctx.save();

            ctx.clearRect(0, 0, canvas.width, canvas.height);

            ctx.translate(width/2,height/2)
            ctx.rotate(rotate*Math.PI/180.0)
            ctx.translate(-width/2,-height/2)

            ctx.beginPath();
            ctx.lineWidth = 10;
            ctx.strokeStyle = primaryColor;
            ctx.arc(canvas.centerWidth,
                    canvas.centerHeight,
                    canvas.radius,
                    angleOffset + canvas.angle,
                    angleOffset + 2*Math.PI);
            ctx.stroke();

            ctx.beginPath();
            ctx.lineWidth = 3;
            ctx.strokeStyle = canvas.secondaryColor;
            ctx.arc(canvas.centerWidth,
                    canvas.centerHeight,
                    canvas.radius,
                    canvas.angleOffset,
                    canvas.angleOffset + canvas.angle);
            ctx.stroke();

            ctx.restore();
        
}

        MouseArea 
{
            id
: mouseArea
            anchors.fill: parent
            visible: circularProgressBar.canClick
            onClicked: canvas.clicked()
            onPressedChanged: canvas.requestPaint()
        
}

        Timer
{
            id
: timer
            interval: 150
;
            running
: true
            repeat: true
;
            onTriggered
: {
                canvas.rotate += 5
            
}
        }
    }
}
posted @ 2019-09-18 10:59 ccsdu2009 阅读(7) | 评论 (0)编辑 收藏

2019年9月17日

import QtQuick 2.11
import QtQuick.Controls 2.4

Rectangle
{
    width
:640
    height:480
    color:"#cfcfc0"

    anchors.margins: 6

    property bool load1: true

    Button
    {
        id:button
        text: "Button"
        anchors.horizontalCenter: parent.horizontalCenter
        onClicked:
        {
            if(area.visible)
                fadeOut.start()
            else
                fadeIn.start()
        
}
    }

    PropertyAnimation
    
{
        id
: fadeOut
        target: area
        duration: 300
        property: "opacity"
        from: 1.0
        to: 0.0

        onStopped: area.visible = false
    
}

    PropertyAnimation
    
{
        id
: fadeIn
        target: area
        duration: 300
        property: "opacity"
        from: 0.0
        to: 1.0

        onStarted: area.visible = true
    
}

    Rectangle
    
{
        id
: area
        width: parent.width - 12
        height: parent.height - button.height - 12
        anchors.horizontalCenter: parent.horizontalCenter
        anchors.topMargin: 6
        anchors.top: button.bottom
        visible: false
        color: "#9900ff00"
    
}
}
posted @ 2019-09-17 16:06 ccsdu2009 阅读(6) | 评论 (0)编辑 收藏
 
上层MouseArea需要接受右键事件,如下
    MouseArea {
        anchors.fill
: parent
        acceptedButtons: Qt.LeftButton | Qt.RightButton
    
}
posted @ 2019-09-17 11:18 ccsdu2009 阅读(10) | 评论 (0)编辑 收藏
 
import QtQuick 2.11
import QtQuick.Controls 2.4

Rectangle
{
    width
:640
    height:480
    color:"#cfcfc0"

    anchors.margins: 6

    MouseArea {
        id: mouseRegion
        anchors.fill: parent
;
        acceptedButtons
: Qt.LeftButton | Qt.RightButton

        onClicked: {
            if(mouse.button == Qt.RightButton)
                contentMenu.popup()
        
}

        Menu 
{
            id
: contentMenu

            MenuItem {
                text: "Cut"
                onTriggered: {
}
            }

            MenuItem 
{
                text
: "Copy"
                onTriggered: {
}
            }

            MenuItem 
{
                text
: "Paste"
                onTriggered: {
}
            }

            MenuSeparator 
{ }

            Menu 
{
                title
: "More"
                MenuItem {
                    text: "Edit"
                
}
                MenuItem 
{
                    text
: "Select All"
                
}
            }
        }
    }
}
posted @ 2019-09-17 11:10 ccsdu2009 阅读(14) | 评论 (0)编辑 收藏
 
 1     Button {
 2         anchors.left: button
 3         text: "菜单"
 4         anchors.leftMargin: 12
 5         onClicked: popupMenu.popup()
 6      }
 7 
 8      Menu {
 9           id : popupMenu
10           title: "&File"
11 
12           MenuItem {
13               text: "&Open"
14               onTriggered:{}
15           }
16 
17           MenuItem {
18               text: "&Save"
19               onTriggered: {}
20           }
21 
22           MenuItem {
23               text: "&Close"
24               onTriggered: Qt.quit()
25           }
26     }
posted @ 2019-09-17 11:06 ccsdu2009 阅读(10) | 评论 (0)编辑 收藏

2019年9月16日

import QtQuick 2.5
import QtQuick.Layouts 1.2
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4

Rectangle 
{
    id
: circularProgressBar
    width: 60
    height: 60

    color: "#333333"
    property real currentValue: 0
    property bool textVisible: true
    property bool canClick: false

    Canvas {
        id: canvas
        anchors.fill: parent
        antialiasing: true

        property color primaryColor: "transparent"
        property color secondaryColor: "lightblue"

        property real centerWidth: width / 2
        property real centerHeight: height / 2
        property real radius: Math.min(canvas.width-10, canvas.height-10) / 2

        property real minimumValue: 0
        property real maximumValue: 100
        property alias currentValue : circularProgressBar.currentValue

        property string text: "0"
        property real angle: (currentValue - minimumValue) / (maximumValue - minimumValue) * 2 * Math.PI
        property real angleOffset: -Math.PI / 2

        onPrimaryColorChanged: requestPaint()
        onSecondaryColorChanged: requestPaint()
        onMinimumValueChanged: requestPaint()
        onMaximumValueChanged: requestPaint()
        onCurrentValueChanged: requestPaint()

        onPaint: {
            var ctx = getContext("2d")
;
            ctx.save();

            ctx.clearRect(0, 0, canvas.width, canvas.height);

            if(mouseArea.pressed) {
                ctx.beginPath();
                ctx.lineWidth = 10;
                ctx.fillStyle = Qt.lighter(canvas.secondaryColor,1.25);
                ctx.arc(canvas.centerWidth,
                        canvas.centerHeight,
                        canvas.radius,
                        0,
                        2*Math.PI);
                ctx.fill();

                timer.running = true;
            
}

            ctx.beginPath();
            ctx.lineWidth = 10;
            ctx.strokeStyle = primaryColor;
            ctx.arc(canvas.centerWidth,
                    canvas.centerHeight,
                    canvas.radius,
                    angleOffset + canvas.angle,
                    angleOffset + 2*Math.PI);
            ctx.stroke();

            ctx.beginPath();
            ctx.lineWidth = 3;
            ctx.strokeStyle = canvas.secondaryColor;
            ctx.arc(canvas.centerWidth,
                    canvas.centerHeight,
                    canvas.radius,
                    canvas.angleOffset,
                    canvas.angleOffset + canvas.angle);
            ctx.stroke();

            ctx.restore();
        }

        Text 
{
            id
: progressText
            anchors.centerIn: parent

            font.pixelSize: 16
            text: canvas.text
            visible: circularProgressBar.textVisible
            color: canvas.secondaryColor
        
}

        MouseArea 
{
            id
: mouseArea
            anchors.fill: parent
            visible: circularProgressBar.canClick
            onClicked: canvas.clicked()
            onPressedChanged: canvas.requestPaint()
        
}

        Timer
{
            id
: timer
            interval: 100
;
            running
: true
            repeat: true
;
            onTriggered
: {

                if(circularProgressBar.currentValue === 100) {
                    circularProgressBar.currentValue = 0
;
                    progressText.text = "0"
                
}

                circularProgressBar.currentValue += 1;
                progressText.text = circularProgressBar.currentValue.toString()+"%";
            }

        }
    }
}
posted @ 2019-09-16 16:38 ccsdu2009 阅读(15) | 评论 (0)编辑 收藏
仅列出标题  下一页