Speaker
SPEAKER is the module for supporting an external speaker with the TI-Innovator™ Hub.
Add Output Device
Item |
Description |
---|---|
Speaker |
Functions for supporting an external speaker with the TI-Innovator™ Hub. The functions are the same as the ones for "sound" above. |
CE products: from speaker import *
TI-Nspire CX II: from ti_hub import *
|
|
|
The function to create the object is pasted from the menu.
var=speaker("port")
Command: |
var=speaker("port") |
---|---|
Command |
var=speaker("port") |
Range: |
|
Describe: |
Creates an object for an external speaker. Port can be OUT 1, OUT 2, OUT 3 or any of the BB port pins. The external speaker has the same API as the built-in speaker. |
Result: |
|
Type or |
Control |
var.tone(freq,time)
Command: |
var.tone(freq,time) |
---|---|
Command |
var.tone(freq,time) |
Range: |
|
Describe: |
Plays a tone specified by ‘freq’ (0-8000 Hz) for the ‘time’ (0.1 – 100s). |
Result: |
|
Type or |
Control |
var.note(“note”,time)
Command: |
var.note(“note”,time) |
---|---|
Command |
var.note(“note”,time) |
Python |
TI Nspire CX II: from ti_hub import * from time import *
sp1=speaker("OUT 1")
sp1.tone(440,2) sleep(2) sp1.note("A4",4) |
|
CE products: from speaker import * from time import *
sp1=speaker("OUT 1")
sp1.tone(440,2) sleep(2) sp1.note("A4",4) |
Range: |
|
Describe: |
Plays a note specified by ‘note’ for the ‘time’ (0.1 – 100s). Notes can be: "C", "CS", "D", "DS", "E", "F", "FS", "G", "GS", "A", "AS", and "B". And the octave numbers range from 1 to 9 (inclusive)). |
Result: |
|
Type or |
Control |