⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme.txt

📁 使用SymbianC++语言开发
💻 TXT
字号:
Running Audio3 on a Nokia 6600 phone
------------------------------------
The audio3 example is hardwired to play a "testing123.raw" file, which is a PCM16
file. The file is assumed to reside on the C: default drive.

The Nokia 6600 phone is not capable of playing PCM16 wave files from the flash drive
(C:) so, in order to run the application on this phone, you will need to make the
following change:

Modify the hardwired file name, in audio3eng.cpp, from "testing123.raw" to
"e:\\testing123.raw".

When installing the application on the Nokia 6600, make sure that you install it to
the "E [Memory card]" drive.

Changing how errors are treated
-------------------------------
The audio3 example is written so that it Panics if playing the file terminates for
any reason other than the user selecting "Stop", including the data stream underflowing.
You may consider this to be rather harsh, and may wish to modify the behaviour by
changing two functions in the way described below.

In the function:

void CSynchronousExampleStream::MaoscPlayComplete(TInt aError)
    {
    if (aError==KErrNone || aError==KErrCancel)//user selected "Stop"
        {
        iEngine->SetState(CAudio3Engine::EReadySynchronous);
        PlayEnded(aError);
        }
    else
        {
        User::Invariant();
        }
    }

you could add a check for aError==KErrUnderflow to the 'if' statement. Alternatively,
and arguably preferably, you could replace the function with the simpler:

void CSynchronousExampleStream::MaoscPlayComplete(TInt aError)
    {
    iEngine->SetState(CAudio3Engine::EReadySynchronous);
    PlayEnded(aError);
    }

The stream will automatically re-initialise itself if the user selects Play() again.

Whichever option you choose, you should also make a corresponding change to the
function CAsynchronousExampleStream::MaoscPlayComplete(TInt aError).

Preventing frames from being dropped
------------------------------------
When playing a file in the asynchronous option, audio3 drops frames when there are
no free buffers to receive the incoming data. This is deliberate, illustrating the
behaviour that would be expected in a real application, but significantly degrades
the sound quality.

You can change this behaviour by deleting the two lines, as indicated below, in the
asynchronous stream;s RunL() function, in audio3eng.cpp.

void CAsynchronousExampleStream::RunL()
    {
    switch (iState)
        {
        case ETimer:
            //A buffer is available to read from the source
            if (iBufList[iEnd].Length()==0)
                {
                iFile.Read(iBufList[iEnd],iStatus);
                iState=EReading;
                SetActive();
                break;
                }
            else
                {//... but ignore it because there are no buffers free
                TInt pos=KBufferSize;          // Delete these two lines to
                iFile.Seek(ESeekCurrent, pos); // stop dropping frames
                RandomDelay();
                break;
                }
    ...
    }

With this modification, the engine will wait indefinitely for a free buffer before
continuing.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -