forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Help with Audio Mechanica

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
PeterLeRoi



Joined: 16 May 2007
Posts: 31

PostPosted: Sat May 26, 2007 4:07 am    Post subject: Help with Audio Mechanica Reply with quote

I´m working with Audio Mechanica´s source code and I´ve realized that in every function there are many:

for(nux=0; nux<55; nux++){ // delay
sceDisplayWaitVblankStart();
}

What are they for? This only "freezes" the screen, no?

Thanks ;)
Back to top
View user's profile Send private message
Art



Joined: 09 Nov 2005
Posts: 647

PostPosted: Sat May 26, 2007 2:12 pm    Post subject: Reply with quote

it pauses program execution for some reason.
In most cases it's to force a delay between working with two different files.
I don't know if it's realy needed in those cases.
Art.
Back to top
View user's profile Send private message
PeterLeRoi



Joined: 16 May 2007
Posts: 31

PostPosted: Wed May 30, 2007 8:48 am    Post subject: And another question Reply with quote

Other question: I need to separate the part of the source code which affects the Yackback option. I´ve seen, inside audioInputLoopCallback();
Code:

         if (monitor == 4){
            if (vox != 0){
               vox--;   // decrement voice activation delay to zero
            }
            pspDebugScreenSetXY(1, sensb);
            printf("     ");
            pspDebugScreenSetTextColor(0x00EFDDCA);
            pspDebugScreenSetBackColor(0x00000000);
            pspDebugScreenSetXY(1, sens);
            printf("VOX >");

            if (k != 33){ // basic high sensitivity
               if (scan < sens){ // experimental industrial sensitivity
                  vox = 45; // set small yakback delay

                  if (voxon == 0){
                     if (recordindex > 20479){
                        replaystart = recordindex - 20480;
                     }
                     else{
                        indexbuf = 20480 - recordindex;
                        replaystart = 11534336 - indexbuf;
                     }
                  }

                  voxon = 1;
                  scan = 33;
               }
            }
            else{ //si k == 33
               if (voxon == 1){
                  if (vox < 1){
                     mode = 1;
                     voxon = 0;
                     yak = recordindex;
                     recordindex = replaystart;
                     pspDebugScreenSetTextColor(0x00EFDDCA);
                     pspDebugScreenSetBackColor(0x00000000);
                     pspDebugScreenSetXY(1, sens);
                     printf("     ");
                  }
               }
            }
         } // monitor = 4


but don´t know what exactly it does. What are k, vox, voxon and scan for? And which sample frequency is yackback using?

Thanks ;)

PD: I´m trying to implement a voice recognition using Audio Mechanica, has anybody already worked on it?
Back to top
View user's profile Send private message
Art



Joined: 09 Nov 2005
Posts: 647

PostPosted: Thu May 31, 2007 4:23 pm    Post subject: Reply with quote

I haven't tried voice recognition yet.
Still getting around to it.

That is why that Yakback feature was really done though.

voxon is 0 or 1 depending if voice activation is set in tape recorder mode.
vox is the level of sensitivity represented by the "VOX >" cursor graphic
on the screen when VOX mode is on.

scan is a variable that is used to seek across a horizontal line to detect the wave.
Art.
Back to top
View user's profile Send private message
PeterLeRoi



Joined: 16 May 2007
Posts: 31

PostPosted: Fri Jun 01, 2007 6:51 am    Post subject: Reply with quote

Thanks for your help Art :D I´m still trying to understand the code... I think the level of sensitivity is determined by "sens"

[/quote]voxon is 0 or 1 depending if voice activation is set in tape recorder mode. [quote]

One question: why there is an if(voxon) inside an if(monitor ==4)? How is monitor == 4 (yakback mode) affected by changes in voxon?

Other thing... what does (k != 33) mean?

Thanks for your help :)
Back to top
View user's profile Send private message
PeterLeRoi



Joined: 16 May 2007
Posts: 31

PostPosted: Wed Jul 04, 2007 3:12 am    Post subject: Reply with quote

I´ve improved a few things on voice recognition using Audio Mechanica´s source code... but there´s one thing can´t understand. "k"... what is it for? I think k contains one sample, next we take the 2º byte... and then nothing :(

Why it makes k = 0, when k is < 0 or > 33? Why

Code:

if (k != 33){ // basic high sensitivity
        if (scan < sens){ // experimental industrial sensitivity


Does anybody have any hint?

Thanks ;)
Back to top
View user's profile Send private message
Art



Joined: 09 Nov 2005
Posts: 647

PostPosted: Wed Jul 04, 2007 6:11 pm    Post subject: Reply with quote

because in debug screen mode, that is how many lines are on the display.
No less than zero, no more than 33.

From the wave drawing routine:
Code:

if (k < scan) {
scan = k;
}

Which actually checks if the wave graphic on the screen went higher
(closer to the top line) than the value in scan.

If ever I started voice recogntion with it, I was planning to use the wave
display as shown on the screen to lower the resolution to something workable.
Art.
Back to top
View user's profile Send private message
PeterLeRoi



Joined: 16 May 2007
Posts: 31

PostPosted: Fri Jul 06, 2007 9:01 am    Post subject: Reply with quote

Thanks for your help Art ;)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group