# US 2021/0286588 A1 · Method and apparatus for playing alarm and electronic device

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2021/0286588 A1
- Document ID: US20210286588A1
- Status: Published application
- Kind: A1
- Application number: 17/332,584
- Filed: 2021-05-27
- Published: 2021-09-16
- Earliest claimed: 2018-12-03
- Assignees: Shenzhen Heytap Technology Corp., Ltd.; Guangdong Oppo Mobile Telecommunications Corp., Ltd.
- Applicants: Shenzhen Heytap Technology Corp., Ltd.; Guangdong Oppo Mobile Telecommunications Corp., Ltd.
- Inventors: Yajun Li
- Web page: https://patentgrep.com/patent/US20210286588A1

## CPC

- G06F 3/165: {Management of the audio stream, e.g. setting of volume, audio stream path}
- H04M 1/6066: {including a wireless connection}
- G06F 3/162: {Interface to dedicated audio devices, e.g. audio drivers, interface to CODECs}
- G06F 9/5011: {the resources being hardware resources other than CPUs, Servers and Terminals}
- G06F 9/526: {Mutual exclusion algorithms}
- G06F 9/542: {Event management; Broadcasting; Multicasting; Notifications}
- H04M 1/72451: according to schedules, e.g. using calendar applications
- H04M 1/72454: according to context-related or environment-related conditions
- H04M 1/72463: to restrict the functionality of the device
- H04M 1/72484: wherein functions are triggered by incoming communication events
- H04M 1/72442: for playing music files
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- H04M: TELEPHONIC COMMUNICATION (circuits for controlling other apparatus via a telephone cable and not involving telephone switching apparatus G08)

## Abstract

The present disclosure provides a method for playing an alarm. The method includes: receiving an instruction to play the alarm; monitoring, before playing the alarm, an occupation state of an audio resource for playing the alarm; obtaining information of an occupier in response to the occupation state indicating that the audio resource is occupied; and releasing the audio resource occupied by the occupier to use the audio resource to play the alarm, in response to the occupier being a non-call application. The present disclosure further provides an apparatus for playing an alarm, an electronic device, and a computer-readable storage medium, capable of solving the problem in the related art associated with abnormal playing of an alarm when an audio resource for playing the alarm is occupied, thereby achieving automatic correction of alarm playing, improving the stability of the system and enhancing the user experience.

## Claims

### Claim 1

A method for playing an alarm, comprising:
receiving an instruction to play the alarm;
monitoring, before playing the alarm, an occupation state of an audio resource for playing the alarm;
obtaining information of an occupier in response to the occupation state indicating that the audio resource is occupied; and
releasing the audio resource occupied by the occupier to use the audio resource to play the alarm, in response to the occupier being a non-call application.

### Claim 2 (depends on 1)

The method according to claim 1, further comprising:
monitoring, in response to the occupier being a call application, a call state of the call application; and
releasing, in response to the call state being a stopped state, the audio resource occupied by the occupier to use the audio resource to play the alarm.

### Claim 3 (depends on 2)

The method according to claim 2, wherein said monitoring the call state of the call application and releasing, in response to the call state being the stopped state, the audio resource occupied by the occupier to use the audio resource to play the alarm comprise:
monitoring, in response to the call state being an active state, whether the call state is switched from the active state to the stopped state within predetermined time;
detecting, in response to monitoring within the predetermined time that the call state is switched from the active state to the stopped state, whether the call application continues to occupy the audio resource;
releasing, in response to detecting that the call application continues to occupy the audio resource after switched to the stopped state, the audio resource occupied by the call application to use the audio resource to play the alarm; and
playing the alarm in response to the call application releasing the audio resource after switched to the stopped state.

### Claim 4 (depends on 1)

The method according to claim 1, further comprising:
providing a backup audio resource, to which an audio behavior of the occupier is switched in response to the occupier releasing the audio resource, such that the audio behavior of the occupier is played normally.

### Claim 5 (depends on 4)

The method according to claim 4, wherein the audio behavior of the occupier being switched to the backup audio resource comprises:
the occupier invoking the backup audio resource according to a priority of the audio behavior, the backup audio resource providing the occupier with a permission to modify the priority.

### Claim 6 (depends on 1)

The method according to claim 1, wherein the information of the occupier comprises: at least one of audio playback information, audio recording information, and audio mode information.

### Claim 7 (depends on 1)

The method according to claim 1, further comprising:
playing the alarm by using the audio resource in response to the occupation state of the audio resource being idle.

### Claim 8

An electronic device, comprising a memory and a processor, wherein the memory is configured to store a computer program which, when executed by the processor, causes the processor to:
receive an instruction to play the alarm;
monitor, before playing the alarm, an occupation state of an audio resource for playing the alarm;
obtain information of an occupier in response to the occupation state indicating that the audio resource is occupied; and
release the audio resource occupied by the occupier to use the audio resource to play the alarm, in response to the occupier being a non-call application.

### Claim 9 (depends on 8)

The electronic device according to claim 8, wherein the computer program, when executed by the processor, further causes the processor to:
monitor, in response to the occupier being a call application, a call state of the call application; and
release, in response to the call state being a stopped state, the audio resource occupied by the occupier to use the audio resource to play the alarm.

### Claim 10 (depends on 9)

The electronic device according to claim 9, wherein said monitoring the call state of the call application and releasing, in response to the call state being the stopped state, the audio resource occupied by the occupier to use the audio resource to play the alarm comprise:
monitoring, in response to the call state being an active state, whether the call state is switched from the active state to the stopped state within predetermined time;
detecting, in response to monitoring within the predetermined time that the call state is switched from the active state to the stopped state, whether the call application continues to occupy the audio resource;
releasing, in response to detecting that the call application continues to occupy the audio resource after switched to the stopped state, the audio resource occupied by the call application to use the audio resource to play the alarm; and
playing the alarm in response to the call application releasing the audio resource after switched to the stopped state.

### Claim 11 (depends on 8)

The electronic device according to claim 8, wherein the computer program, when executed by the processor, further causes the processor to:
provide a backup audio resource, to which an audio behavior of the occupier is switched in response to the occupier releasing the audio resource, such that the audio behavior of the occupier is played normally.

### Claim 12 (depends on 11)

The electronic device according to claim 11, wherein the audio behavior of the occupier being switched to the backup audio resource comprises:
the occupier invoking the backup audio resource according to a priority of the audio behavior, the backup audio resource providing the occupier with a permission to modify the priority.

### Claim 13 (depends on 8)

The electronic device according to claim 8, wherein the information of the occupier comprises: at least one of audio playback information, audio recording information, and audio mode information.

### Claim 14 (depends on 1)

The electronic device according to claim 1, wherein the computer program, when executed by the processor, further causes the processor to:
play the alarm by using the audio resource in response to the occupation state of the audio resource being idle.

### Claim 15

A non-transitory computer-readable storage medium, having a computer program stored thereon, the computer program, when executed by a processor, causes the processor to:
receive an instruction to play the alarm;
monitor, before playing the alarm, an occupation state of an audio resource for playing the alarm;
obtain information of an occupier in response to the occupation state indicating that the audio resource is occupied; and
release the audio resource occupied by the occupier to use the audio resource to play the alarm, in response to the occupier being a non-call application.

### Claim 16 (depends on 15)

The non-transitory computer-readable storage medium according to claim 15, wherein the computer program, when executed by a processor, further causes the processor to:
monitor, in response to the occupier being a call application, a call state of the call application; and
release, in response to the call state being a stopped state, the audio resource occupied by the occupier to use the audio resource to play the alarm.

### Claim 17 (depends on 16)

The non-transitory computer-readable storage medium according to claim 16, wherein said monitoring the call state of the call application and releasing, in response to the call state being the stopped state, the audio resource occupied by the occupier to use the audio resource to play the alarm comprise:
monitoring, in response to the call state being an active state, whether the call state is switched from the active state to the stopped state within predetermined time;
detecting, in response to monitoring within the predetermined time that the call state is switched from the active state to the stopped state, whether the call application continues to occupy the audio resource;
releasing, in response to detecting that the call application continues to occupy the audio resource after switched to the stopped state, the audio resource occupied by the call application to use the audio resource to play the alarm; and
playing the alarm in response to the call application releasing the audio resource after switched to the stopped state.

### Claim 18 (depends on 15)

The non-transitory computer-readable storage medium according to claim 15, wherein the computer program, when executed by a processor, further causes the processor to:
provide a backup audio resource, to which an audio behavior of the occupier is switched in response to the occupier releasing the audio resource, such that the audio behavior of the occupier is played normally.

### Claim 19 (depends on 18)

The non-transitory computer-readable storage medium according to claim 18, wherein the audio behavior of the occupier being switched to the backup audio resource comprises:
the occupier invoking the backup audio resource according to a priority of the audio behavior, the backup audio resource providing the occupier with a permission to modify the priority.

### Claim 20 (depends on 15)

The non-transitory computer-readable storage medium according to claim 15, wherein the computer program, when executed by a processor, further causes the processor to:
play the alarm by using the audio resource in response to the occupation state of the audio resource being idle.
