Reader small image

You're reading from  OpenCV for Secret Agents

Product typeBook
Published inJan 2015
Reading LevelIntermediate
PublisherPackt
ISBN-139781783287376
Edition1st Edition
Languages
Right arrow
Author (1)
Joseph Howse
Joseph Howse
author image
Joseph Howse

Joseph Howse lives in a Canadian fishing village, where he chats with his cats, crafts his books, and nurtures an orchard of hardy fruit trees. He is President of Nummist Media Corporation, which exists to support his books and to provide mentoring and consulting services, with a specialty in computer vision. On average, in 2015-2022, Joseph has written 1.4 new books or new editions per year for Packt. He also writes fiction, including an upcoming novel about the lives of a group of young people in the last days of the Soviet Union.
Read more about Joseph Howse

Right arrow

Playing audio clips as questions and answers


The logic of the question and answer sequence is another component that has no computer vision functionality. We will encapsulate it in a class called YesNoAudioTree, which is responsible for playing the next audio clip whenever the app's computer vision component notifies it of a "Yes" or "No" answer.

Note

Remember to download the audio clips and other resources from http://nummist.com/opencv/7376_04_res.zip and extract them to the project's res/raw folder. However, note that the audio clips in this download are by no means an exhaustive set of questions and guesses about characters in the Bond franchise. Feel free to add your own clips and your own logic for playing them.

Create a file, src/YesNoAudioTree.java. Our YesNoAudioTree class needs member variables to store a media player and a related context, an ID for the most recently played audio clip, and information gathered from the answers to the previous questions. Specifically, the next question...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
OpenCV for Secret Agents
Published in: Jan 2015Publisher: PacktISBN-13: 9781783287376

Author (1)

author image
Joseph Howse

Joseph Howse lives in a Canadian fishing village, where he chats with his cats, crafts his books, and nurtures an orchard of hardy fruit trees. He is President of Nummist Media Corporation, which exists to support his books and to provide mentoring and consulting services, with a specialty in computer vision. On average, in 2015-2022, Joseph has written 1.4 new books or new editions per year for Packt. He also writes fiction, including an upcoming novel about the lives of a group of young people in the last days of the Soviet Union.
Read more about Joseph Howse