feat: replace placeholder sounds with actual MP3 recordings and refine audio logic
This commit is contained in:
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -68,10 +68,14 @@ export function SoundController() {
|
|||||||
prevIsScreenSharing.current = state.isScreenSharing;
|
prevIsScreenSharing.current = state.isScreenSharing;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Disconnect
|
// Disconnect (Self)
|
||||||
if (prevIsConnected.current && !state.isLiveKitConnected) {
|
if (prevIsConnected.current && !state.isLiveKitConnected) {
|
||||||
audioManager.playSound('disconnect');
|
audioManager.playSound('disconnect');
|
||||||
}
|
}
|
||||||
|
// Connect (Self)
|
||||||
|
if (!prevIsConnected.current && state.isLiveKitConnected) {
|
||||||
|
audioManager.playSound('user_join');
|
||||||
|
}
|
||||||
prevIsConnected.current = state.isLiveKitConnected;
|
prevIsConnected.current = state.isLiveKitConnected;
|
||||||
|
|
||||||
// Participant Joins/Leaves & Screen Sharing
|
// Participant Joins/Leaves & Screen Sharing
|
||||||
@@ -79,28 +83,28 @@ export function SoundController() {
|
|||||||
const currentScreenShareUserIds = new Set(state.participants.filter(p => p.isScreenSharing).map(p => p.userId));
|
const currentScreenShareUserIds = new Set(state.participants.filter(p => p.isScreenSharing).map(p => p.userId));
|
||||||
|
|
||||||
if (state.isLiveKitConnected) {
|
if (state.isLiveKitConnected) {
|
||||||
// Someone joined voice
|
// Someone joined voice (Others only)
|
||||||
state.participants.forEach(p => {
|
state.participants.forEach(p => {
|
||||||
if (!prevParticipantIds.current.has(p.userId) && p.userId !== currentUser?.id) {
|
if (!prevParticipantIds.current.has(p.userId) && p.userId !== currentUser?.id) {
|
||||||
audioManager.playSound('user_join');
|
audioManager.playSound('user_join');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Someone left voice
|
// Someone left voice (Others only)
|
||||||
prevParticipantIds.current.forEach(userId => {
|
prevParticipantIds.current.forEach(userId => {
|
||||||
if (!currentParticipantIds.has(userId) && userId !== currentUser?.id) {
|
if (!currentParticipantIds.has(userId) && userId !== currentUser?.id) {
|
||||||
audioManager.playSound('user_leave');
|
audioManager.playSound('user_leave');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Someone started screen sharing
|
// Someone started screen sharing (Others only)
|
||||||
state.participants.forEach(p => {
|
state.participants.forEach(p => {
|
||||||
if (p.isScreenSharing && !prevScreenShareUserIds.current.has(p.userId) && p.userId !== currentUser?.id) {
|
if (p.isScreenSharing && !prevScreenShareUserIds.current.has(p.userId) && p.userId !== currentUser?.id) {
|
||||||
audioManager.playSound('stream_user_joined');
|
audioManager.playSound('stream_user_joined');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Someone stopped screen sharing
|
// Someone stopped screen sharing (Others only)
|
||||||
prevScreenShareUserIds.current.forEach(userId => {
|
prevScreenShareUserIds.current.forEach(userId => {
|
||||||
if (!currentScreenShareUserIds.has(userId) && userId !== currentUser?.id) {
|
if (!currentScreenShareUserIds.has(userId) && userId !== currentUser?.id) {
|
||||||
audioManager.playSound('stream_user_left');
|
audioManager.playSound('stream_user_left');
|
||||||
|
|||||||
Reference in New Issue
Block a user