Skip to content

Commit

Permalink
Stop voice messages that are playing when starting a recording
Browse files Browse the repository at this point in the history
  • Loading branch information
turt2live committed Aug 5, 2021
1 parent 570c2b3 commit 17a3dc5
Showing 1 changed file with 4 additions and 0 deletions.
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

0 comments on commit 17a3dc5

Please sign in to comment.