pxt-calliope/docs/reference/devices/tell-microphone-to.md

51 lines
999 B
Markdown
Raw Normal View History

2016-03-26 00:47:20 +01:00
# tell microphone to
2016-04-02 01:22:47 +02:00
The tell microphone to function.
2016-03-26 00:47:20 +01:00
Access the audio recording capabilities of the device using the ``tell microphone to`` function.
The functions in the antenna namespace allow the BBC micro:bit to communicate with a separate (remote) device, such as a smartphone, over Bluetooth (Smart). The set of supported events will depend on the remote device and the BBC micro:bit apps available for the remote device.
### Block Editor
![](/static/mb/tell-microphone-to-0.png)
2016-04-18 17:33:09 +02:00
### JavaScript
2016-03-26 00:47:20 +01:00
```sig
2016-03-26 00:47:20 +01:00
export function tellMicrophoneTo(event: string)
```
### Parameters
* event - an event identifier
### Event values
* play
* stop
* pause
* forward
* rewind
* volume up
* volume down
* previous track
* next track
### Examples
To tell the connected device to start recording audio
```blocks
2016-04-16 00:53:20 +02:00
devices.tellMicrophoneTo("start capture")
2016-03-26 00:47:20 +01:00
```
To tell the connected device to stop recording audio
```blocks
2016-04-16 00:53:20 +02:00
devices.tellMicrophoneTo("stop capture")
2016-03-26 00:47:20 +01:00
```
```package
microbit-devices
```