@ant-design/icons#SoundOutlined JavaScript Examples
The following examples show how to use
@ant-design/icons#SoundOutlined.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Waveform.js From label-studio-frontend with Apache License 2.0 | 4 votes |
render() {
const self = this;
const speeds = ["0.5", "0.75", "1.0", "1.25", "1.5", "2.0"];
return (
<div>
<div id="wave" ref={this.setWaveformRef} className={styles.wave} />
<div id="timeline" />
{this.props.zoom && (
<Row gutter={16} style={{ marginTop: "1em" }}>
<Col flex={8} style={{ textAlign: "right", marginTop: "6px" }}>
<div style={{ display: "flex" }}>
<div style={{ marginTop: "6px", marginRight: "5px" }}>
<Tooltip placement="topLeft" title="Horizontal zoom out">
<ZoomOutOutlined onClick={this.onZoomMinus} className={globalStyles.link} />
</Tooltip>
</div>
<div style={{ width: "100%" }}>
<Slider
min={0}
step={10}
max={500}
value={typeof this.state.zoom === "number" ? this.state.zoom : 0}
onChange={value => {
this.onChangeZoom(value);
}}
/>
</div>
<div style={{ marginTop: "6px", marginLeft: "5px" }}>
<Tooltip placement="topLeft" title="Horizontal zoom in">
<ZoomInOutlined onClick={this.onZoomPlus} className={globalStyles.link} />
</Tooltip>
</div>
</div>
</Col>
<Col flex={4} style={{ textAlign: "right", marginTop: "6px" }}>
<div style={{ display: "flex" }}>
<div style={{ marginTop: "6px", marginRight: "5px" }}>
<Tooltip placement="topLeft" title="Vertical zoom out">
<ZoomOutOutlined onClick={this.onZoomYMinus} className={globalStyles.link} />
</Tooltip>
</div>
<div style={{ width: "100%" }}>
<Slider
min={MIN_ZOOM_Y}
step={.1}
max={MAX_ZOOM_Y}
value={typeof this.state.zoomY === "number" ? this.state.zoomY : MIN_ZOOM_Y}
onChange={value => {
this.onChangeZoomY(value);
}}
/>
</div>
<div style={{ marginTop: "6px", marginLeft: "5px" }}>
<Tooltip placement="topLeft" title="Vertical zoom in">
<ZoomInOutlined onClick={this.onZoomYPlus} className={globalStyles.link} />
</Tooltip>
</div>
</div>
</Col>
<Col flex={3}>
{this.props.volume && (
<div style={{ display: "flex", marginTop: "6.5px" }}>
<div style={{ width: "100%" }}>
<Slider
min={0}
max={1}
step={0.1}
value={typeof this.state.volume === "number" ? this.state.volume : 1}
onChange={value => {
this.onChangeVolume(value);
}}
/>
</div>
<div style={{ marginLeft: "10px", marginTop: "5px" }}>
<SoundOutlined />
</div>
</div>
)}
</Col>
<Col flex={1} style={{ marginTop: "6px" }}>
{this.props.speed && (
<Select
placeholder="Speed"
style={{ width: "100%" }}
defaultValue={this.state.speed}
onChange={self.onChangeSpeed}
>
{speeds.map(speed => (
<Select.Option value={+speed} key={speed}>
Speed {speed}
</Select.Option>
))}
</Select>
)}
</Col>
</Row>
)}
</div>
);
}
Example #2
Source File: Controller.js From network-rc with Apache License 2.0 | 4 votes |
render() {
const {
fixContent,
ttsInput,
props: {
statusInfo,
action,
cameraEnabled,
videoEl,
onTTS,
ttsPlaying,
setting,
playAudio,
serverConfig,
changeChannel,
editabled,
cameraList,
channelStatus,
saveServerConfig,
isFullscreen,
session,
webrtcChannel,
},
} = this;
const { isShowButton, ttsInputVisible, text } = this.state;
const { channelList = [], specialChannel = {} } = serverConfig;
const speedChannel = channelList.find(
({ id }) => id === specialChannel.speed
);
const { audioList = [] } = serverConfig;
return (
<div className="controller">
<Router className="controller-router">
<Ai
path="ai/learn/*"
canvasRef={videoEl}
cameraEnabled={cameraEnabled}
action={action}
onAi={(isAiControlling) => this.setState({ isAiControlling })}
/>
<ObjectDetection
path="ai/coco-ssd/*"
videoEl={videoEl}
cameraEnabled={cameraEnabled}
action={action}
onAi={(isAiControlling) => this.setState({ isAiControlling })}
/>
</Router>
{!isFullscreen && (
<Form className="controller-form" size="small" layout="inline">
<Form.Item>
<Popover
content={fixContent}
title="修正"
trigger="click"
placement="topLeft"
>
<Button icon={<SlidersOutlined />}>修正</Button>
</Popover>
</Form.Item>
{speedChannel && (
<>
<Form.Item>
<Popover
placement="topLeft"
content={
<Slider
defaultValue={speedChannel.valuePostive * 100}
min={0}
max={100}
onChange={(v) => {
speedChannel.valuePostive = v / 100;
saveServerConfig({
channelList,
});
}}
arrowPointAtCenter
style={{ width: "30vw" }}
/>
}
>
<Button shape="round">
前进:{Math.round(speedChannel.valuePostive * 100)}
</Button>
</Popover>
</Form.Item>
<Form.Item>
<Popover
placement="topLeft"
content={
<Slider
defaultValue={speedChannel.valueNegative * -100}
min={0}
max={100}
style={{ width: "30vw" }}
onChange={(v) => {
speedChannel.valueNegative = (v / 100) * -1;
saveServerConfig({
channelList,
});
}}
/>
}
>
<Button shape="round">
倒退:{Math.round(speedChannel.valueNegative * -100)}
</Button>
</Popover>
</Form.Item>
</>
)}
<Form.Item>
<Gamepad
changeChannel={changeChannel}
channelList={serverConfig.channelList}
channelStatus={channelStatus}
playAudio={playAudio}
serverConfig={serverConfig}
/>
</Form.Item>
<Form.Item>
<Orientation
changeChannel={changeChannel}
channelStatus={channelStatus}
serverConfig={serverConfig}
/>
</Form.Item>
<Form.Item>
<Keybord
playAudio={playAudio}
channelStatus={channelStatus}
channelList={serverConfig.channelList}
changeChannel={changeChannel}
serverConfig={serverConfig}
onEnter={() => {
this.setState({ ttsInputVisible: true });
setTimeout(() => {
ttsInput.current && ttsInput.current.focus();
}, 200);
}}
/>
</Form.Item>
<Form.Item>
<Popover
arrowPointAtCenter
trigger="click"
placement="topRight"
visible={ttsInputVisible}
onVisibleChange={(ttsInputVisible) => {
this.setState({ ttsInputVisible });
setTimeout(() => {
ttsInput.current && ttsInput.current.focus();
}, 200);
}}
content={
<form>
<Input.Search
ref={ttsInput}
name="tts"
style={{ width: "60vw" }}
placeholder="发送语音"
enterButton="发送"
value={text}
onChange={(e) => this.setState({ text: e.target.value })}
onSearch={(text) => {
onTTS(text);
this.setState({ text: "" });
}}
loading={ttsPlaying}
onKeyDown={(e) => {
e.stopPropagation();
if (e.key === "Escape") {
this.setState({ ttsInputVisible: false });
}
}}
/>
</form>
}
>
<Button shape="round">
<SendOutlined />
</Button>
</Popover>
</Form.Item>
{audioList
.filter((i) => i.showFooter)
.map(({ path, text, name }) => (
<Form.Item key={name}>
<Button
shape="round"
onClick={() => playAudio({ path, text })}
icon={<SoundOutlined />}
>
{name}
</Button>
</Form.Item>
))}
<Form.Item>
<Popover
placement="topRight"
content={
<Space size={[16, 16]} wrap>
<Form.Item extra="显示触控 UI">
<Switch
checked={isShowButton}
onChange={(isShowButton) => {
store.set("is-show-button", isShowButton);
this.setState({ isShowButton });
}}
checkedChildren={<DragOutlined />}
unCheckedChildren={<DragOutlined />}
/>
</Form.Item>
{audioList
.filter((i) => !i.showFooter)
.map(({ path, text, name, type }) => (
<Form.Item extra={`播放${name}`} key={name}>
{type === "audio" && (
<Button
shape="round"
onClick={() => playAudio({ path })}
icon={<SoundOutlined />}
>
{name}
</Button>
)}
{type === "text" && (
<Button
shape="round"
onClick={() => playAudio({ text })}
icon={<SoundOutlined />}
>
{name}
</Button>
)}
{type === "stop" && (
<Button
shape="round"
onClick={() => playAudio({ stop: true })}
icon={<StopOutlined />}
>
{name}
</Button>
)}
</Form.Item>
))}
</Space>
}
>
<Button shape="round">
<MoreOutlined />
</Button>
</Popover>
</Form.Item>
<Form.Item>
<Microphone
url={
setting.host &&
`${
window.location.protocol === "https:" ? "wss://" : "ws://"
}${setting.host}/audio`
}
/>
</Form.Item>
</Form>
)}
<ControlUI
webrtcChannel={webrtcChannel}
session={session}
channelStatus={channelStatus}
isShowButton={isShowButton}
uiComponentList={serverConfig.uiComponentList}
channelList={serverConfig.channelList}
changeChannel={changeChannel}
editabled={editabled}
cameraList={cameraList}
setting={setting}
isFullscreen={isFullscreen}
statusInfo={statusInfo}
/>
</div>
);
}