Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Stop voice messages that are playing when starting a recording #6563

Merged
merged 1 commit into from
Aug 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/components/views/rooms/VoiceRecordComposerTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import NotificationBadge from "./NotificationBadge";
import { StaticNotificationState } from "../../../stores/notifications/StaticNotificationState";
import { NotificationColor } from "../../../stores/notifications/NotificationColor";
import InlineSpinner from "../elements/InlineSpinner";
import { PlaybackManager } from "../../../audio/PlaybackManager";

interface IProps {
room: Room;
Expand Down Expand Up @@ -177,6 +178,9 @@ export default class VoiceRecordComposerTile extends React.PureComponent<IProps,
}

try {
// stop any noises which might be happening
await PlaybackManager.instance.playOnly(null);

const recorder = VoiceRecordingStore.instance.startRecording();
await recorder.start();

Expand Down