# \[Group Chat\] How to play New VoiceMessage automatically?

**URL:** https://community.sendbird.com/t/group-chat-how-to-play-new-voicemessage-automatically/8781
**Category:** Android
**Created:** [December 22, 2023, 7:12am UTC](https://community.sendbird.com/t/group-chat-how-to-play-new-voicemessage-automatically/8781 "2023-12-22T07:12:47Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![message-center](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/message-center/32/4803_2.png) [@message-center](https://community.sendbird.com/u/message-center)
#### Post date: [December 22, 2023, 7:12am UTC](https://community.sendbird.com/t/group-chat-how-to-play-new-voicemessage-automatically/8781/1 "2023-12-22T07:12:47Z")

</div>

**[Problem/Question]**  
// Detailed description of issue.

How can I implement a feature where the latest received voice message of type VIEW\_TYPE\_VOICE\_MESSAGE\_OTHER is automatically played if the current chat window is open? However, if another voice message is already being played or if I am currently recording my own voice, the latest received voice message should not be played.

How can I implement this functionality?

* * *

class CustomChannelFragment : ChannelFragment() {  
…  
override fun onMessageClicked(view: View, position: Int, message: BaseMessage) {  
Toast.makeText(requireContext(), “Message Click Sample”, Toast.LENGTH\_SHORT).show()  
super.onMessageClicked(view, position, message)  
}

…  
}

inner class CustomChannelMessageListAdapter(channel: GroupChannel, useMessageGroupUI: Boolean) :  
MessageListAdapter(channel, useMessageGroupUI) {

```
    override fun onBindViewHolder(holder: MessageViewHolder, position: Int) {
        super.onBindViewHolder(holder, position)
        val message = getItem(position)

        if (message is FileMessage) {
            onMessageClicked(holder.itemView, position, message)
        } else {
            Log.d("ChannelMessageListAdapter", "message type - not file")
        }

    }

```

}

Looking at the code, it seems that although onBindViewHolder calls onMessageClicked, there is no actual implementation for playing the voice message.

* * *

* * *

// If problem, please fill out the below. If question, please delete.  
**[UIKit Version]**  
// What version of the SDK are you using?  
New Android SDK

**[Reproduction Steps]**  
// Please provide reproduction steps and, if possible, code snippets.  
Always click event  
**[Frequency]**  
// How frequently is this issue occurring?

**[Current impact]**  
// How is this currently impacting your implementation?
