Ultrasound(removed after v1.1)
Constructor
opt | Object | null | The config of Ultrasound |
var ultrasound = new Jsonic.Ultrasound();
Property
AudioContext | Object | The contect of the track |
Coder | Object | The Object for acoustic coding |
Method
.createSender()
create an instance of SonicSender
var sender = ultrasound.createSender();
.createAccepter()
create an instance of SonicAccepter
var accepter = ultrasound.createAccepter();
SonicSender
Method
.send()
msg | string | The message to send.(By default, only 0-9 can be sent.) |
callback | Function | null | callback function |
Send a message by ultrasound
sender.send('123');
SonicAccepter
Method
.start()
start to listen to the sonic
accepter.start();
.stop()
stop listening to the sonic
accepter.stop();
.bind()
bind event
msg | string | message |
func | Function | null | event |
accepter.bind('123',event);
.unbind()
unbind event
msg | string | message |
func | Function | null | event |
accepter.unbind('123',event);
.one()
bind an event which will be fired only once
msg | string | message |
func | Function | null | event |
accepter.one('123',event);