Jump to content
IGNORED

IntyBASIC v1.4.0 call for testers


nanochess

Recommended Posts

What is the right programming pattern to queue 4 voices, begin to play the first one, make the program loop-wait for a side button press, and then play no other voices remaining in the queue if a button is pressed? I would like to test the VOICE INIT functionality to get things to stop (as shown in voice.bas in the "samples" dir) but am not sure how to do it properly, proto-code is below.

	SirPlaysALot: Procedure
		Voice Play SomethingOne
		Voice Play SomethingTwo
		Voice Play SomethingThree
		Voice Play SomethingFour
		Do
			Print At 140 Color 2, "Playing"
			Wait
		Loop Until (Cont.Button)
		VOICE INIT
		Return
	End

Thanks.

 

 

 

[snip]
o VOICE INIT now "shuts up" the Intellivision (contributed by intvnut) and the initializatin is done in automatic form at start of program.

[snip]

Edited by First Spear
Link to comment
Share on other sites

What is the right programming pattern to queue 4 voices, begin to play the first one, make the program loop-wait for a side button press, and then play no other voices remaining in the queue if a button is pressed? I would like to test the VOICE INIT functionality to get things to stop (as shown in voice.bas in the "samples" dir) but am not sure how to do it properly, proto-code is below.

	SirPlaysALot: Procedure
		Voice Play SomethingOne
		Voice Play SomethingTwo
		Voice Play SomethingThree
		Voice Play SomethingFour
		Do
			Print At 140 Color 2, "Playing"
			Wait
		Loop Until (Cont.Button)
		VOICE INIT
		Return
	End

Thanks.

 

 

 

 

Your code looks good for me.

Link to comment
Share on other sites

I suppose by your answer that VOICE PLAY will queue the phrase. Is that accurate? The manual makes no indication of this. In fact, it suggests otherwise:

 

VOICE PLAY label
Starts speaking, if queue is full some phrases can be lost.
Link to comment
Share on other sites

There are a few voice commands/options in manual.txt, and I am not sure how they work. The queueing/dequeueing and interrupting play are unclear to me.

 

I am not sure about this, so please someone correct me if I'm wrong, but I believe that there are two levels of queueing at play. There's the low-level queueing that occurs at the allophone level in the Intellivoice API; and there is the phrase queuing that happens at the IntyBASIC level, where it buffers a VOICE PLAY command and plays it when the previous one is done. At least this is how it looks to be presented by the API.

 

However, I believe that in practice, it is more crude than that, and that the IntyBASIC-level queueing is merely just breaking down your phrase and adding its allophones to the Intellivoice API queue. To me that's what the warning in the manual suggests.

 

Therefore, if the underlying queue supports, say, 10 allophones, and you issue a VOICE PLAY command with a 5-allophone phrase; then IntyBASIC "buffers" the phrase by adding all 5 allophones to the queue.

 

If you then issue another VOICE PLAY command with a 10-allphone phrase immediately after, then IntyBASIC will be able to add only half of it to the queue, dropping the rest.

 

Essentially, the queue is at the allophone level and not at the phrase level. This seems to me like a leaky abstraction.

 

Oscar, if the above were correct, would it be possible to just abstract the underlying queue by having IntyBASIC buffer full phrases and add them to the queue as it opens up?

 

Never mind all that. I just looked at the assembled code and the VOICE PLAY command calls IV_PLAY underneath, which employs a phrase-level queue. It seems at a glance that it can hold 8 phrases. Therefore, consequent VOICE PLAY commands add phrases to the queue and return immediately; and if you don't wait until they are actually played, they may overflow the queue and get dropped.

 

-dZ.

  • Like 1
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...