Help with Audio Mechanica

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
PeterLeRoi
Posts: 31
Joined: Wed May 16, 2007 11:08 am

Help with Audio Mechanica

Post by PeterLeRoi »

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 ;)
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

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.
PeterLeRoi
Posts: 31
Joined: Wed May 16, 2007 11:08 am

And another question

Post by PeterLeRoi »

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

Code: Select all

			if &#40;monitor == 4&#41;&#123;
				if &#40;vox != 0&#41;&#123;
					vox--;	// decrement voice activation delay to zero
				&#125;
				pspDebugScreenSetXY&#40;1, sensb&#41;;
				printf&#40;"     "&#41;;
				pspDebugScreenSetTextColor&#40;0x00EFDDCA&#41;;
				pspDebugScreenSetBackColor&#40;0x00000000&#41;;
				pspDebugScreenSetXY&#40;1, sens&#41;;
				printf&#40;"VOX >"&#41;;

				if &#40;k != 33&#41;&#123; // basic high sensitivity
					if &#40;scan < sens&#41;&#123; // experimental industrial sensitivity
						vox = 45; // set small yakback delay

						if &#40;voxon == 0&#41;&#123;
							if &#40;recordindex > 20479&#41;&#123;
								replaystart = recordindex - 20480;
							&#125;
							else&#123;
								indexbuf = 20480 - recordindex;
								replaystart = 11534336 - indexbuf;
							&#125;
						&#125;

						voxon = 1;
						scan = 33;
					&#125;
				&#125;
				else&#123; //si k == 33
					if &#40;voxon == 1&#41;&#123;
						if &#40;vox < 1&#41;&#123;
							mode = 1;
							voxon = 0;
							yak = recordindex;
							recordindex = replaystart;
							pspDebugScreenSetTextColor&#40;0x00EFDDCA&#41;;
							pspDebugScreenSetBackColor&#40;0x00000000&#41;;
							pspDebugScreenSetXY&#40;1, sens&#41;;
							printf&#40;"     "&#41;;
						&#125;
					&#125;
				&#125;
			&#125; // 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?
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

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.
PeterLeRoi
Posts: 31
Joined: Wed May 16, 2007 11:08 am

Post by PeterLeRoi »

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 :)
PeterLeRoi
Posts: 31
Joined: Wed May 16, 2007 11:08 am

Post by PeterLeRoi »

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: Select all

if &#40;k != 33&#41;&#123; // basic high sensitivity
        if &#40;scan < sens&#41;&#123; // experimental industrial sensitivity 
Does anybody have any hint?

Thanks ;)
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

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: Select all

if &#40;k < scan&#41; &#123;
scan = k;
&#125;
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.
PeterLeRoi
Posts: 31
Joined: Wed May 16, 2007 11:08 am

Post by PeterLeRoi »

Thanks for your help Art ;)
Post Reply